1.设置导航栏标题字体颜色
[paneNavigationViewController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName : [UIColor whiteColor], NSFontAttributeName : [UIFont systemFontOfSize:16]}];
2.设置导航栏背景图片
[paneNavigationViewController.navigationBar setBackgroundImage:[UIImage imageNamed:@"daohangtiao"] forBarMetrics:UIBarMetricsDefault];
3.设置导航栏标题颜色
[self.navigationController.navigationBar setTintColor:[UIColor whiteColor]];
[[UINavigationBar appearance] setTintColor:[UIColor whiteColor]];
4.将返回按钮的文字position设置不在屏幕上显示
[[UIBarButtonItem appearance] setBackButtonTitlePositionAdjustment:UIOffsetMake(NSIntegerMin, NSIntegerMin) forBarMetrics:UIBarMetricsDefault];
5.去掉Navigationbar 下方黑线
[[UINavigationBar appearance] setBackgroundImage:[[UIImage alloc] init] forBarMetrics:UIBarMetricsDefault];
[[UINavigationBar appearance] setShadowImage:[[UIImage alloc] init]];
本文详细介绍了如何在iOS应用中自定义导航栏的标题字体颜色、背景图片、标题颜色,以及调整返回按钮的位置,并移除底部黑线,提供了一套完整的导航栏样式设置指南。

565

被折叠的 条评论
为什么被折叠?



