ios 更改全局UINavigationBar的背景图片以及通知栏颜色

1.更改UINavigationController push 到另一个界面返回按钮的title

self.navigationController.navigationBar.topItem.backBarButtonItem = [[UIBarButtonItem alloc]initWithTitle:@"Back" style:UIBarButtonItemStylePlain target:nil action:nil];

2.更改全局UINavigationBar的背景图片以及通知栏颜色

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
UIImage *navBackgroundImage = [UIImage imageNamed:@"navbar.png"];
[[UINavigationBar appearance] setBackgroundImage:navBackgroundImage forBarMetrics:UIBarMetricsDefault];
}

3.设置全局UIBarButtonItem的背景颜色

[[UIBarButtonItem appearance] setTintColor:[UIColor colorWithRed:/255.0 green:128.0/255.0 blue:192.0/255.0 alpha:1.0]];

4.设置title标题颜色

NSDictionary *textTitleOptions = [NSDictionarydictionaryWithObjectsAndKeys:[UIColordarkGrayColor], UITextAttributeTextColor, [UIColorwhiteColor], UITextAttributeTextShadowColor, nil];

上一篇:阿里下一代云分析型数据库AnalyticDB入选Forrester云化数仓象限


下一篇:PMD使用提醒