如何设置UITabBarItem 选中时的背景色

如图图片描述

类似Instagram 的tabBar,选中的时候的item的背景色更深。怎么设置啊,我已经把UITabBar apperance 试过差不多了都。还有就是UITabBarItem在未选中情况下的颜色怎么设置

    [[UITabBar appearance]setBackgroundColor:[UIColor myDarkGrayColorDark]];
    [[UITabBar appearance]setTintColor:[UIColor myThemeColor]];
    [[UITabBar appearance]setBarTintColor:[UIColor myDarkGrayColor]];
    [[UITabBar appearance]setBarStyle:UIBarStyleBlack];
    [[UITabBar appearance]setSelectedImageTintColor:[UIColor whiteColor]];
阅读 6k
1 个回答

这里应该是自定义的tabbar,设置button的两种状态的image就ok了。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题