问题
I've been trying to find the solution to this for the last week, and I have had no luck after trying every possible solution I could find or think of. Every solution I found and have attempted has not worked.
I have 4 UITabBarItem's in a UITabBar placed within UITabBarController. I want to put individual background color (OR image) of the UITabBarItem. Screen shot is attached
I am using Swift, and iOS SDK 9.3 in Xcode 8.0. If you can only answer in Objective-C that is fine too, any answer will help! Thank you all in advance, I really appreciate it!
回答1:
I hope that -at least- one of the following links to be useful to your case:
Creating a Custom Tab Bar.
Tabbar with custom colors.
iOS Custom UI Series: TabBar & NavBar.
iOS TUTORIAL: Creating a custom tabbar using Storyboard in Xcode.
RXCustomTabBar.
iOS custom tabbar.
How to create custom tab bar in Swift.
回答2:
you can subclass the uitabbarcontroller and in this class in the viewDidLoad function add a views with background colors and imageViews with these icons to this view and make the view userInteractionEnabled = false
来源:https://stackoverflow.com/questions/41139914/how-to-make-multiple-color-tab-bar-in-swift-3