美文网首页
UITabBarItem笔记

UITabBarItem笔记

作者: xgou | 来源:发表于2016-08-15 17:29 被阅读25次

选中前后字体的颜色变化。

[UITabBarItem.appearance setTitleTextAttributes:@{NSForegroundColorAttributeName : GrayFontColor} forState:UIControlStateNormal];

[UITabBarItem.appearance setTitleTextAttributes:@{NSForegroundColorAttributeName : YellowColor} forState:UIControlStateSelected];

标题距离图片的位置偏移如下

[UITabBarItem.appearance setTitlePositionAdjustment:UIOffsetMake(0, -5)];
还有就是如果选中后image没有变化成自己预设的图,那就需要选中要预设的图在Xcode右边的属性最后那个选项卡的下面有个Render as设置成Original Image即可变化。

相关文章

网友评论

      本文标题:UITabBarItem笔记

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