百思不得姐项目学习总结

来源:互联网 发布:精通shell编程 知乎 编辑:程序博客网 时间:2024/04/30 00:42

少叙述,多代码,简单粗暴最高效。

tabBarItem的tiltle属性设置

NSMutableDictionary *selectedAttrs = [NSMutableDictionary dictionary];    selectedAttrs[NSFontAttributeName] = [UIFont systemFontOfSize:12];    selectedAttrs[NSForegroundColorAttributeName] = [UIColor darkGrayColor];    [vc01.tabBarItem setTitleTextAttributes:selectedAttrs forState:UIControlStateSelected];
[UINavigationBar appearance];    // 通过appearance统一设置所有UITabBarItem的文字属性    // 后面带有UI_APPEARANCE_SELECTOR的方法, 都可以通过appearance对象来统一设置    NSMutableDictionary *attrs = [NSMutableDictionary dictionary];    attrs[NSFontAttributeName] = [UIFont systemFontOfSize:12];    attrs[NSForegroundColorAttributeName] = [UIColor grayColor];    NSMutableDictionary *selectedAttrs = [NSMutableDictionary dictionary];    selectedAttrs[NSFontAttributeName] = attrs[NSFontAttributeName];    selectedAttrs[NSForegroundColorAttributeName] = [UIColor darkGrayColor];    UITabBarItem *item = [UITabBarItem appearance];    [item setTitleTextAttributes:attrs forState:UIControlStateNormal];    [item setTitleTextAttributes:selectedAttrs forState:UIControlStateSelected];
0 0
原创粉丝点击