How to make multiple color tab bar in swift 3

百般思念 提交于 2019-12-24 06:26:30

问题


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:

  1. Creating a Custom Tab Bar.

  2. Tabbar with custom colors.

  3. iOS Custom UI Series: TabBar & NavBar.

  4. iOS TUTORIAL: Creating a custom tabbar using Storyboard in Xcode.

  5. RXCustomTabBar.

  6. iOS custom tabbar.

  7. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!