appearance

作者: yzu | 来源:发表于2016-02-17 22:08 被阅读82次

通过appearance统一设置所有UITabBarItem的文字属性
NSMutableDictionary *attrs = [NSMutableDictionary dictionary];
attrs[NSFontAttributeName] = [UIFont systemFontOfSize:12];
attrs[NSForegroundColorAttributeName] = [UIColor grayColor];

NSMutableDictionary *selectAttrs = [NSMutableDictionary dictionary];
selectAttrs[NSFontAttributeName] = [UIFont systemFontOfSize:12];
selectAttrs[NSForegroundColorAttributeName] = [UIColor darkGrayColor];

UITabBarItem *item = [UITabBarItem appearance];
[item setTitleTextAttributes:attrs forState:UIControlStateNormal];
[item setTitleTextAttributes:selectAttrs forState:UIControlStateSelected];

后面带有UI_APPEARANCE_SELECTOR的方法,都可以通过appearance对象来统一设置

相关文章

  • AS配置

    配置 主题Appearance&Behavior->Appearance 字体Appearance&Behavio...

  • appearance

    css3属性,在 firefox 和 chrome中支持良好,可以用来修复iPhone上submit按钮bug 功...

  • appearance

  • Appearance

    Appearance Proxies UIAppearance是一个协议 UIView默认已经遵守了这个协议 来看...

  • appearance

    UINavigationController和 UITabBarController都可以通过appearance...

  • appearance

    通过appearance统一设置所有UITabBarItem的文字属性NSMutableDictionary *a...

  • Appearance

    UIAppearance是一个协议 UIView默认已经遵守了这个协议 来看看UIAppearance都有什么方法...

  • 导航栏设置透明失效

    UINavigationBar *appearance = [UINavigationBar appearance...

  • idea修改编辑器字体大小

    设置 -> Appearance & Behavior -> Appearance -> Use custom ...

  • 2017.3.25 English Study Notes

    appearance, physical appearance,looks 外貌 facial features ...

网友评论

    本文标题:appearance

    本文链接:https://www.haomeiwen.com/subject/mojmkttx.html