UITabBar not showing selected item images in ios 7

后端 未结 20 1820
我在风中等你
我在风中等你 2020-11-29 18:36

The icons show fine in ios 6 but not in ios 7. I\'m setting the selected state in the viewController viewDidLoad method. When the user selects a tab bar item the image disap

20条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-29 18:54

    Set bar item image's render mode to original can solve this problem. This can be done by using images in the .xcassets, so you don't have to write lots of codes.

    First step, drap&drop your bar item images to Assets.xcassets.

    Second step, choose the bar item image, and change [Render As] to [Original Image]

    ps: I usually set the TabBarController's tab bar items all by story board to avoid writing lots of code.

提交回复
热议问题