Home  >  Q&A  >  body text

ios - 如何设置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]];
伊谢尔伦伊谢尔伦2763 days ago363

reply all(1)I'll reply

  • 黄舟

    黄舟2017-04-17 15:06:43

    This should be a custom tabbar. Set the image of the two states of the button and it will be ok.

    reply
    0
  • Cancelreply