简体   繁体   中英

How do I fully customise TabBar in iOS

I need to customise TabBar in my iOS Application as shown in the image 在此处输入图片说明

I need to change the background colour, unselected image tint colour and selected image tint colour. How can this be done

For that you need to set barTintColor and tintColor property of UITaBbar .

self.tabBarController?.tabBar.barTintColor = .blue //Background Color
self.tabBarController?.tabBar.tintColor = .yellow //Selected Item tint color

Note: If you have image for both state means default and selected, then set both the images for its sets, check this answer to set selected image for tabbar item. Now set the Render mode of both the image to Original Image in assets, if you don't know how to set that check this answer .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM