设置全局导航,button,UITextField样式

来源:互联网 发布:南风知我意1txt书包网 编辑:程序博客网 时间:2024/06/05 10:42
/设置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];

0 0
原创粉丝点击