我是靠谱客的博主 奋斗过客,这篇文章主要介绍关于导航栏和状态栏的一些UI设置,现在分享给大家,希望可以做个参考。

   //是否隐藏导航栏   动画效果

 [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设置的全部内容,更多相关关于导航栏和状态栏内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(45)

评论列表共有 0 条评论

立即
投稿
返回
顶部