1

的颜色我能找到2名的方法来改变导航栏的后退按钮IOS改变后退按钮

1)[self.navigationItem.backBarButtonItem setTintColor:[UIColor colorWithRed:0 green:0.3294 blue:0.5764 alpha:1]]; 虽然看着简单的这个方法是不是working..dont知道为什么吗?

2)[[UIBarButtonItem appearance] setTintColor:[UIColor colorWithRed:0 green:0.3294 blue:0.5764 alpha:1]]; 此方法在IOS5上正常工作。但此方法不存在于较低版本中,因此导致应用程序崩溃。

是否有任何改变后杠按钮颜色的方法?

+0

见 http://stackoverflow.com/questions/7929382/ios-5-how-to-change-the-color-of-back-button -in-A-导航条 –

回答

1

backBarButtonItem on navigationItem是一个UIBarButtonItem,它的颜色可以通过在iOS 5或更高版本中可用的tint color属性来设置。

iOS 4中的备用解决方案: 设置self.navigationController.navigationBar.tintColor,从iOS 2起,将后退按钮颜色设置为相同。

请参阅本更多information