Ste*_*ghe 8 cocoa-touch uibarbuttonitem ios
我正试图改变文本背后阴影的偏移量UIBarButtonItem.
这是我的代码:
NSMutableDictionary *attributes = [NSMutableDictionary dictionary];
[attributes setValue:[UIColor colorWithWhite:0.30 alpha:1.0] forKey:UITextAttributeTextColor];
[attributes setValue:[UIColor whiteColor] forKey:UITextAttributeTextShadowColor];
[attributes setValue:[NSValue valueWithUIOffset:UIOffsetMake(0.0, 0.0)] forKey:UITextAttributeTextShadowOffset];
[[UIBarButtonItem appearance] setTitleTextAttributes:attributes forState:UIControlStateNormal];
Run Code Online (Sandbox Code Playgroud)
更改文本颜色有效.更改阴影颜色有效.更改阴影偏移似乎没有任何作用.
我这样做的方式有问题吗?我也试过直接设置它,没有外观代理,但这也不起作用.
| 归档时间: |
|
| 查看次数: |
3652 次 |
| 最近记录: |