iOS关于UIStoryboard中TabBar图标文字的选中颜色问题

之前我们都是用代码来实现,那么多代码,看起来一点都不简洁,今天终于找到了一个好方法。

  • 图标

前提:图标要在Assets.xcassets中。

  1. Assets.xcassets中选中要设置的图标
  2. 打开右侧的属性编辑面板
  3. 看一看第二项Render as
  4. 设置为Original Image

  • 文字
  1. 在Storyboard文件中选中TabBar
  2. 打开右侧的属性编辑面板
  3. 选中第二个标签页(show the identity inspector)
  4. 在Use Defined Runtime Attributes中添加一项
  5. KeyPath为tintColor,Type为Color,Value自己选颜色

猜你喜欢

转载自blog.csdn.net/u011433287/article/details/79041079