你如何在iOS
中使用UIBarItem
中的setTitleTextAttributes:forState:
?
你怎么设定NSDictionary
?无法使其工作,而且文档对此也不是很清楚.
From the documentation:
setTitleTextAttributes:forState:
Sets the title’s text attributes for a given control state:
- (void)setTitleTextAttributes:(NSDictionary *)attributes
forState:(UIControlState)state
参数:
属性:包含文本属性键值对的字典.可以使用NSString UIKit Additions Reference中列出的键指定字体、文本 colored颜色 、文本阴影 colored颜色 和文本阴影偏移量.
状态:要为其设置标题的文本属性的控件状态.