laz*_*rev 16 appearance uibarbuttonitem uibarbuttonitemstyle ios5
我们的设计师让我为禁用的UIBarButtonItems文本使用特定颜色.我用来实现这个代码:
NSDictionary* textAttributes = [NSDictionary dictionaryWithObject: [UIColor blueColor]
forKey: UITextAttributeTextColor];
[[UIBarButtonItem appearance] setTitleTextAttributes: textAttributes
forState: UIControlStateDisabled];
Run Code Online (Sandbox Code Playgroud)
但它没有改变文本属性.
我已尝试使用Normal状态的代码,尝试使用setBackgroundImage为UIControlStateDisabled按钮添加背景,并且所有thouse实验都能正常工作.但是这个单一的组合:setTitleTextAttributes和UIControlStateDisabled没有做任何事情.
谷歌没有给我任何关于这个特定组合的相关答案.
有没有人知道改变禁用的UIBarButtonItem的颜色的其他方法或使setTitleTextAttributes适用于diabled项目的方法?
| 归档时间: |
|
| 查看次数: |
6757 次 |
| 最近记录: |