IOS 5如何更改导航栏中后退按钮的颜色? [英] IOS 5 How to change the color of back button in a navigation bar?

查看:169
本文介绍了IOS 5如何更改导航栏中后退按钮的颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想更改导航栏的后退按钮的颜色,使其看起来像这样

I want to change the color of back button of a navigation bar to make it look like this

推荐答案

设置 backBarButtonItem > tintColor :

Set the backBarButtonItem's tintColor:

self.navigationItem.backBarButtonItem.tintColor = [UIColor redColor];

提示:如果您希望将其应用于全部默认情况下,应用程序中的 UIBarButtonItem 实例,则可以使用新的 UIAppearance API:

TIP: If you want this to be applied to all UIBarButtonItem instances in your application by default, then you can use the new UIAppearance API to do just that:

[[UIBarButtonItem appearance] setTintColor:[UIColor redColor]];

这篇关于IOS 5如何更改导航栏中后退按钮的颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆