Tab bar appearance for iphone and ipad for both image and text color in normal and selected mode iOS swift

 Solution:

You can able to change the bar appearance for iphone and ipad for both image and text color in normal and selected mode 

        let tabBarAppearance = UITabBarAppearance()

        let tabBarItemAppearance = UITabBarItemAppearance()

        tabBarItemAppearance.normal.iconColor = color

        tabBarItemAppearance.normal.titleTextAttributes = [NSAttributedString.Key.foregroundColorcolor]

        tabBarAppearance.stackedLayoutAppearance = tabBarItemAppearance


        self.tabBar.standardAppearance = tabBarAppearance


The above code will works for iphone But in ipad you want to add the below code


        tabBarAppearance.inlineLayoutAppearance = tabBarItemAppearance



Comments

Popular posts from this blog

Invalid bundle error while upload the app to the app Store

Saved Image in document directory and save path in coredata not able to fetch the image file iOS swift