关于UITextAttributeTextColor,NSForegroundColorAttributeName的问题

UITextAttributeTextColor的问题

 

objc中使用UITextAttributeTextColor

    [[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:navigationBarColor,UITextAttributeTextColor, nil] forState:UIControlStateSelected];

 

swift中使用NSForegroundColorAttributeName

   UITabBarItem.appearance().setTitleTextAttributes([NSForegroundColorAttributeName:navigationBarColor], forState: UIControlState.Selected)

 

Wrong:’UITextAttributeTextColor' is unavailable: Use NSForegroundColorAttributeName            

UITabBarItem.appearance().setTitleTextAttributes([UITextAttributeTextColor:navigationBarColor], forState: UIControlState.Selected)

 

 

objc

NSDictionary dic = [NSDictionary dictionaryWithObjectsAndKeys:navigationBarColor,UITextAttributeTextColor, nil

equals

NSDictionary dic = [UITextAttributeTextColor:navigationBarColor

posted on 2016-07-29 23:07  LouisQian  阅读(462)  评论(0编辑  收藏  举报

导航