/设置Nav的背景色和title色
UINavigationBar *navigationBarAppearance = [UINavigationBar appearance];
NSDictionary *textAttributes = nil;
[navigationBarAppearance setTintColor:[UIColor whiteColor]];//返回按钮的箭头颜色
[[UITextField appearance] setTintColor:[UIColor colorWithHexString:@"0x3bbc79"]];//设置UITextField的光标颜色
[[UITextView appearance] setTintColor:[UIColor colorWithHexString:@"0x3bbc79"]];//设置UITextView的光标颜色
[[UISearchBar appearance] setBackgroundImage:[UIImage imageWithColor:[UIColor colorWithHexString:@"0xe5e5e5"]] forBarPosition:0 barMetrics:UIBarMetricsDefault];
textAttributes = @{
NSFontAttributeName: [UIFont boldSystemFontOfSize:kNavTitleFontSize],
NSForegroundColorAttributeName: [UIColor whiteColor],
};
[navigationBarAppearance setBackgroundImage:[UIImage imageWithColor:[UIColor colorWithHexString:@"0x28303b"]] forBarMetrics:UIBarMetricsDefault];
[navigationBarAppearance setTitleTextAttributes:textAttributes];
设置全局导航,button,UITextField样式
最新推荐文章于 2019-08-16 03:42:00 发布