Ios 如何修改导航栏上的左右项
我想全局编辑导航栏上的左右项目字体 取消是左边的项目,完成是右边的项目Ios 如何修改导航栏上的左右项,ios,uinavigationcontroller,uinavigationitem,Ios,Uinavigationcontroller,Uinavigationitem,我想全局编辑导航栏上的左右项目字体 取消是左边的项目,完成是右边的项目 它需要与中间的标题分开,我已经有了如下代码(在App委托中指定): 谢谢 在didFinishLaunchingWithOptions中的AppDelegate上处理这段代码: // Change the appearance of back button UIImage *backButtonImage = [[UIImage imageNamed:@"button_back"] resizableImageWit
它需要与中间的标题分开,我已经有了如下代码(在App委托中指定):
谢谢 在didFinishLaunchingWithOptions中的AppDelegate上处理这段代码:
// Change the appearance of back button
UIImage *backButtonImage = [[UIImage imageNamed:@"button_back"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 13, 0, 6)];
[[UIBarButtonItem appearance] setBackButtonBackgroundImage:backButtonImage forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
// Change the appearance of other navigation button
UIImage *barButtonImage = [[UIImage imageNamed:@"button_normal"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 6, 0, 6)];
[[UIBarButtonItem appearance] setBackgroundImage:barButtonImage forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
FOT文本:
[[UINavigationBar appearance] setTitleTextAttributes: [NSDictionary dictionaryWithObjectsAndKeys:
[UIColor colorWithRed:245.0/255.0 green:245.0/255.0 blue:245.0/255.0 alpha:1.0], UITextAttributeTextColor,
[UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.8],UITextAttributeTextShadowColor,
[NSValue valueWithUIOffset:UIOffsetMake(0, 1)],
UITextAttributeTextShadowOffset,
[UIFont fontWithName:@"HelveticaNeue-CondensedBlack" size:21.0], UITextAttributeFont, nil]];
或者,您可以使用修改按钮的文本颜色
[[UINavigationBar appearance] setTintColor:[UIColor whiteColor]];
而且。。。你的观点的结构是什么?导航控制器?将添加和删除哪些其他按钮?你尝试了什么?用代码更新了。这个stackoverflow问题不是我需要的,而是谢谢。你需要提供有关按钮的详细信息,而不是标题。需要修改字体和字体颜色我的答案不好。答案为文本编辑
[[UINavigationBar appearance] setTintColor:[UIColor whiteColor]];