如何在uitabbarcontroller中更改uitabbaritem的默认灰色? [英] How to change default the gray color of uitabbaritem in uitabbarcontroller?

查看:133
本文介绍了如何在uitabbarcontroller中更改uitabbaritem的默认灰色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在tabbarcontroller应用程序中,所有取消选择的图像选项卡都是灰色,我想将其更改为白色。

In tabbarcontroller application, all deselected image tabs have gray color, i want to change it into white.

任何帮助都会感激!

推荐答案

您需要构建自己的控制器。根据关于此问题的Apple文档此类[UITabBarController]不用于子类化。 UITabBarItem上的文档说明当您为标签栏提供图像时标签栏上显示的图像是从该图像派生的。因此,您提供给标签栏的任何图像都将被操纵,使其符合标签栏图像的正常外观。

You will need to build your own controller. Per the Apple docs on the matter "This class [UITabBarController] is not intended for subclassing". The docs on the UITabBarItem say that when you are supplying an image for the tab bar "The images displayed on the tab bar are derived from this image". So, whatever image you provide to the tab bar will get manipulated to make it conform to the "normal" look of a tab bar image.

因此,您可以构建一个UIViewController将一些UIButtons作为子视图,然后以这种方式管理整个外观。

So, you can build a UIViewController with some UIButtons as subviews and then manage the entire look and feel that way.

恕我直言,这看起来好像很多工作并没有带来很多好处。

IMHO, this seems like a lot of work for not a lot of gain.

这篇关于如何在uitabbarcontroller中更改uitabbaritem的默认灰色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆