简体   繁体   English

如何在swift 3中制作多个颜色标签栏

[英]How to make multiple color tab bar in swift 3

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. 我在UITabBar中放置了4个UITabBarItem,位于UITabBarController中。 I want to put individual background color (OR image) of the UITabBarItem. 我想要放置UITabBarItem的单个背景颜色(OR图像)。 Screen shot is attached 屏幕截图已附上 在此输入图像描述

I am using Swift, and iOS SDK 9.3 in Xcode 8.0. 我在Xcode 8.0中使用Swift和iOS SDK 9.3。 If you can only answer in Objective-C that is fine too, any answer will help! 如果您只能在Objective-C中回答也没问题,那么任何答案都会有所帮助! Thank you all in advance, I really appreciate it! 提前谢谢大家,我真的很感激!

你可以继承uitabbarcontroller并在viewDidLoad函数的这个类中添加带有背景颜色的视图和带有这些图标的imageViews到这个视图并使视图userInteractionEnabled = false

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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