且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

UIBarButtonItem setTintColor在iOS7上不起作用

更新时间:2023-01-03 11:51:50

在iOS7中你需要更改 navigationBar 按钮颜色,您必须为 navgationBar 设置 tintColor 而不是特定 barButton 了。

In iOS7 you if you need to change the navigationBar buttons color, you must set tintColor for the navgationBar not the for specific barButton any more.

navigationController.navigationBar.tintColor = [UIColor orangeColor];

编辑:这适用于iOS7,您需要进行检查:

this works in iOS7, you need to do the check:

float systemVersion = [[[UIDevice currentDevice] systemVersion] floatValue];
if (systemVersion >= 7.0)
{
    navigationController.navigationBar.tintColor = [UIColor orangeColor]
}