Changing tab bar item image and text color iOS

前端 未结 22 1155
说谎
说谎 2020-12-02 06:10

Here is my tab bar:

\"enter

The following image shows the program being run an

22条回答
  •  星月不相逢
    2020-12-02 06:49

    Simply add a new UITabBarController reference to the project.Next create a reference of UITabBar in this controller:

    @IBOutlet weak var appTabBar: UITabBar!
    

    In its viewDidLoad(), simply add below for title text color:

        appTabBar.tintColor = UIColor.scandidThemeColor()
    

    For image

        tabBarItem = UITabBarItem(title: "FirstTab", image: UIImage(named: "firstImage"), selectedImage: UIImage(named: "firstSelectedImage"))
    

提交回复
热议问题