概述
//是否隐藏导航栏 动画效果
[self.navigationControllersetNavigationBarHidden:YESanimated:YES];
//底部状态栏 是否隐藏
self.hidesBottomBarWhenPushed
self.tabBarController.tabBar.hidden
//设置状态栏选中后 颜色
[[UITabBarItem appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor colorWithHexString:@"ff5d49"]} forState:(UIControlStateSelected)] ;
//设置状态栏item图片 原图效果
[nav.tabBarItem setImage:[UIImage imageNamed:[NSString stringWithFormat:@"%@",imageArray[i]]]];
nav.tabBarItem.selectedImage = [[UIImage imageNamed:[NSString stringWithFormat:@"%@",selectImageArray[i]]] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
//设置默认系统左上角 PUSH的字符为返回 ,在前一个界面设置,当跳转到下一个界面的时候
self.navigationItem.backBarButtonItem = [[UIBarButtonItemalloc] initWithTitle:NSLocalizedString(@"返回",nil) style:UIBarButtonItemStylePlaintarget:nilaction:nil];
// 设置导航栏的颜色字体
UIImage *image = [UIImageimageWithColor:kBlueColorThemesize:CGSizeMake(1,1)];
[[UINavigationBarappearance] setBackgroundImage:imageforBarMetrics:UIBarMetricsDefault];
[[UINavigationBarappearance] setTintColor:[UIColorblueColor]];
[[UINavigationBarappearance] setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColorblueColor],NSFontAttributeName:kNavTitleFont}];
[[UINavigationBarappearance] setShadowImage:[UIImageimageWithColor:[UIColorclearColor] size:CGSizeMake(320,.5)]];
[[UIApplicationsharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
最后
以上就是奋斗过客为你收集整理的关于导航栏和状态栏的一些UI设置的全部内容,希望文章能够帮你解决关于导航栏和状态栏的一些UI设置所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复