iPhone:TabBar图像的颜色?
我已向 TabBar 添加了图像(橙色),但是当我运行应用程序时图像显示为灰色! 我该如何解决这个问题? 谢谢
I have added an image(Orange color) to TabBar, but when I run application image shown gray !
How can I slove this problem ?
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
颜色固定为蓝色。您可以尝试编写自己的自定义选项卡栏界面,或者将一些东西组合在一起,将自定义图标放置在子类
UITabBarController
中的选项卡栏上,如下所示:同时执行以下操作:
UIView
属性(非原子,保留)称为activeOverlay
tabbar
属性,并将其挂接到 IB 中的选项卡栏,setActiveCustomOverlay
时选项卡发生变化。这是一个丑陋的黑客行为,但却是在现有项目中最容易实现的修复方法。苹果也不会拒绝。
对于 iPad,您需要调整数字,并使用更宽的标签栏图像。
The color is fixed to blue. You could either try to write your own custom tab bar interface, or hack together something to place custom icons over the tab bar in a subclassed
UITabBarController
, like this:And also do this:
UIView
property (nonatomic, retain) calledactiveOverlay
tabbar
property and hook it to the tab bar in IBsetActiveCustomOverlay
whenever the tab changes.This is an ugly hack, but the easiest fix to implement in existing projects. Apple will not reject it either.
For iPad you need to tweak the numbers, and use wider tab bar images.
标签栏图像颜色无法更改,应始终为默认颜色。请阅读 ios 的人机界面指南以获取更多详细信息。
The tab bar image color cannot be changed, it should be always be in the default color. Do read the Human interface guidelines of ios for more details.