Created
June 5, 2012 13:22
-
-
Save nicwise/2874948 to your computer and use it in GitHub Desktop.
This file contains 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
public static void SetAppearance() | |
{ | |
if (Util.IsIOS5OrBetter) | |
{ | |
UINavigationBar.Appearance.SetBackgroundImage( | |
Resources.NavBarHeaderBackground, | |
UIBarMetrics.Default); | |
UIBarButtonItem.Appearance.SetBackgroundImage( | |
Resources.BarButtonNormal.CreateResizableImage(new UIEdgeInsets(0,5,0,5)), | |
UIControlState.Normal, | |
UIBarMetrics.Default); | |
UIBarButtonItem.Appearance.SetBackButtonBackgroundImage( | |
Resources.BarButtonBackNormal.CreateResizableImage(new UIEdgeInsets(0,15,0,5)), | |
UIControlState.Normal, | |
UIBarMetrics.Default); | |
//Only if the UIBarButtonItem is in a UISearchBar | |
UIBarButtonItem.AppearanceWhenContainedIn(typeof(UISearchBar)).SetBackgroundImage ( | |
Resources.BarButtonCancelNormal.CreateResizableImage(new UIEdgeInsets(5,5,5,5)), | |
UIControlState.Normal, | |
UIBarMetrics.Default); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment