Skip to content

Instantly share code, notes, and snippets.

@muyexi
Created November 13, 2014 04:18
Show Gist options
  • Save muyexi/ea5955723518272c8776 to your computer and use it in GitHub Desktop.
Save muyexi/ea5955723518272c8776 to your computer and use it in GitHub Desktop.
Custom iOS6 UI to like iOS7
[[UIBarButtonItem appearance] setBackgroundImage:[UIImage new]
forState:UIControlStateNormal
barMetrics:UIBarMetricsDefault];
[[UINavigationBar appearance] setTitleTextAttributes:@{
NSForegroundColorAttributeName: [UIColor blackColor],
NSFontAttributeName: [UIFont systemFontOfSize:17],
UITextAttributeTextShadowOffset: [NSValue valueWithUIOffset:UIOffsetZero]
}];
[[UIBarButtonItem appearance] setTitleTextAttributes:@{
UITextAttributeFont: [UIFont systemFontOfSize:17],
UITextAttributeTextShadowOffset: [NSValue valueWithUIOffset:UIOffsetZero]
}
forState:UIControlStateNormal];
[[UITabBar appearance] setBackgroundImage:[UIImage imageWithColor:[UIColor gray225]]];
[[UITabBar appearance] setSelectionIndicatorImage:[UIImage new]];
//Custom back button image for iOS6 & iOS7
[[UIBarButtonItem appearance] setBackButtonBackgroundImage:[[UIImage imageNamed:@"icon_tabbar_back"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 18, 0, 0)]
forState:UIControlStateNormal
barMetrics:UIBarMetricsDefault];
//Hide back button title for iOS6 & iOS7
[[UIBarButtonItem appearance] setBackButtonTitlePositionAdjustment:UIOffsetMake(0, -60)
forBarMetrics:UIBarMetricsDefault];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment