您的位置:首页 > 其它

状态栏 导航栏 tabbar背景色&字体颜色设置

2016-04-13 14:14 666 查看
状态栏样式设置:ios9后要在info.plist中设置View controller-based status bar appearance==NO,默认是YES,设置后修改状态栏的样式代码才管用,
[[UIApplicationsharedApplication]setStatusBarStyle:UIStatusBarStyleLightContentanimated:NO];或在对应的viewcontroller中:

-(UIStatusBarStyle)preferredStatusBarStyle

{

    returnUIStatusBarStyleLightContent;

    

}

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

    // Override point for customization after application launch.

    

    [[UINavigationBarappearance]
setBarTintColor:[UIColorblueColor]];//导航栏颜色

    [[UINavigationBar appearance] setTintColor:[UIColor whiteColor]]; //导航栏返回按钮(除标题)等其他地方的颜色

    [[UINavigationBarappearance]setTitleTextAttributes:@{NSFontAttributeName:[UIFontsystemFontOfSize:20],NSForegroundColorAttributeName:[UIColorredColor]}];//导航栏标题颜色&字体,在对应的viewcontroller中用self.title
= @"测试";

//

    [[UITabBarappearance]
setTintColor:[UIColorredColor]];//tabbar选中文字颜色

    [[UITabBarappearance]setBarTintColor:[UIColorblueColor]];//整个tabbar的颜色

    [[UIApplicationsharedApplication]
setStatusBarStyle:UIStatusBarStyleLightContentanimated:NO];//状态栏样式

return YES;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: