您的位置:首页 > 移动开发 > IOS开发

开发小技巧:1.iOS初始化系统主题

2016-08-15 19:40 429 查看
在AppDelegate中 初始化系统主题 , APP中全部用到这些东西的地方全被改变了

(void)initSystemTheme
{
//UIBarButtonItem:去除返回按钮的默认文字、设置按钮的颜色
[[UIBarButtonItem appearance] setBackButtonTitlePositionAdjustment:UIOffsetMake(0, -60) forBarMetrics:UIBarMetricsDefault];
[[UIBarButtonItem appearance] setTintColor:[UIColor whiteColor]];

//UINavigationBar:设置App中导航栏的颜色、标题颜色
[[UINavigationBar appearance] setBarTintColor:[UIColor colorWithRed:51.0/255 green:153.0/255 blue:255.0/255 alpha:1]];

[[UINavigationBar appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor]}];

[[UITableView appearance] setBackgroundColor:[UIColor colorWithWhite:0.97 alpha:1]];

[[UITableView appearance] setSectionIndexBackgroundColor:[UIColor clearColor]];

[[UITabBar appearance] setBarTintColor:[UIColor colorWithWhite:0.94 alpha:1]];
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐