【发布时间】:2014-11-16 22:02:55
【问题描述】:
我想在高亮状态下更改 UIBarButtons 的颜色,但我无法让它工作。现在我使用 setTintColor 设置颜色,这设置了我的条的颜色。
[[UIBarButtonItem appearance] setTintColor:[UIColor colorWithRed:108/255.0f green:108/255.0f blue:108/255.0f alpha:1.0f]];
但是当我尝试更改高亮状态的颜色时它不起作用,这就是我正在尝试的。
[[UIBarButtonItem appearance] setTitleTextAttributes:[UIColor colorWithRed:122/255.0f green:122/255.0f blue:122/255.0f alpha:1.0f] forState:UIControlStateHighlighted];
有没有办法解决这个问题?
【问题讨论】:
-
这个答案可能对你有帮助http://stackoverflow.com/a/9503822/1884961
标签: ios objective-c uibarbuttonitem