Preserving the original image color of the selected and unselected UITabBar icons

后端 未结 4 760
心在旅途
心在旅途 2021-01-01 13:42

The structure is the following:

In my storyboard, I have a Tab Bar Controller which contains a Tab Bar object. This object has a custom cla

4条回答
  •  旧巷少年郎
    2021-01-01 14:46

    Swift 3:

        for item in self.tabBar.items!{
            item.selectedImage = item.selectedImage?.withRenderingMode(.alwaysOriginal)
            item.image = item.image?.withRenderingMode(.alwaysOriginal)
        }
    

提交回复
热议问题