Created
November 30, 2017 22:15
-
-
Save rdelrosario/06e5e60ce0617876ff89743e23b18d1b to your computer and use it in GitHub Desktop.
Android - Title Background
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void UpdateTitleViewLayoutBackground(LinearLayout titleViewLayout, string backgroundResource, Android.Graphics.Drawables.Drawable defaultBackground) | |
{ | |
if (!string.IsNullOrEmpty(backgroundResource)) | |
{ | |
titleViewLayout?.SetBackgroundResource(this.Context.Resources.GetIdentifier(backgroundResource, "drawable", Android.App.Application.Context.PackageName)); | |
} | |
else | |
{ | |
titleViewLayout?.SetBackground(defaultBackground); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment