iOS 5:tabBarItem setTitleTextAttributes for selected vs unselected state

时间:2012-10-15 13:16:32

标签: ios ios5 uitabbaritem

为UITabBarItem UIControlStateNormal设置的属性覆盖了UIControlStateSelected!

[navigationCtrl.tabBarItem setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys: [Util colorFromHex:@"474747"], UITextAttributeTextColor, [UIColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:1.0], UITextAttributeTextShadowColor, [NSValue valueWithUIOffset:UIOffsetMake(1.0, 1.0)],  UITextAttributeTextShadowOffset, nil] forState:UIControlStateNormal];

[navigationCtrl.tabBarItem setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys: [Util colorFromHex:@"FCFCFC"],UITextAttributeTextColor, nil]  forState:UIControlStateSelected];

为什么?

0 个答案:

没有答案