How do I change background color of UITabItem when item is selected

前端 未结 11 1089
暖寄归人
暖寄归人 2021-02-01 19:15

I would like a different background color when the user selects a tab bar item than when it is unselected.

11条回答
  •  北荒
    北荒 (楼主)
    2021-02-01 19:52

    Answer in swift 4:

    setSelectedImageTintColor is deprecated on iOS 8.

    Instead use this :

    self.tabBar.tintColor = UIColor.white

提交回复
热议问题