【发布时间】:2012-12-10 15:23:10
【问题描述】:
我按照answer 将栏项目文本颜色更改为白色,但我有 6 个标签栏项目,我无法获取系统按钮 [更多] 项目并更改文本颜色。
如何将此 [more] 按钮文本颜色更改为白色? 谢谢。
我的代码:
for (UITabBarItem* item in self.tabBar.items)
{
NSLog(@"title:%@",item.title); // only get my items
[item setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:
[UIFont fontWithName:@"AmericanTypewriter" size:11.0f], UITextAttributeFont,
[UIColor whiteColor], UITextAttributeTextColor,
[UIColor clearColor], UITextAttributeTextShadowColor,
[NSValue valueWithUIOffset:UIOffsetMake(0.0f, 1.0f)], UITextAttributeTextShadowOffset,
nil] forState:UIControlStateNormal];
}
【问题讨论】:
-
你是用[UITabBarItem外观]还是smth。还有吗?
-
是的,
tabBar.items我只得到我的物品,无法得到系统moretabbaritem,所以我不能在上面使用setTitleTextAttributes -
@jaydee3,对不起,我明白了,它工作!非常感谢!
标签: objective-c uitabbar uitabbaritem