您的位置:首页 > 产品设计 > UI/UE

iOS7设置UINavigationBar的标题格式

2015-07-16 14:54 453 查看
在iOS7之前,通过设置UITextAttributeTextColor即可,
NSMutableDictionary *atts = [NSMutableDictionary dictionary];

atts[UITextAttributeTextColor] = [UIColor whiteColor];

在iOS7之后,UITextAttributeTextColor属性作废,改为NSForegroundColorAttributeName属性
NSMutableDictionary *atts = [NSMutableDictionary dictionary];

atts[NSForegroundColorAttributeName] = [UIColor whiteColor];

在学习过程中可以由旧属性推出新属性,可以先使用UITextAttributeTextColor,进入该属性后会看到API的如下提示
UIKIT_EXTERN NSString *const UITextAttributeTextColor NS_DEPRECATED_IOS(5_0, 7_0, "Use NSForegroundColorAttributeName");
所以完全可以通过系统自带的提示找到新属性
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: