iPhone - 使标签栏透明 [英] iPhone - Making a Tab Bar Transparent
问题描述
如何在 cocoa touch 中使标签栏透明?
How do I make a tab bar transparent in cocoa touch?
推荐答案
由于UITabBar
是UIView
的子类,你有没有试过调整它的alpha代码>属性?
Since UITabBar
is a subclass of UIView
, have you tried adjusting its alpha
property?
请注意,如果您尝试修改与 UITabBarController
关联的标签栏,则应考虑来自 Apple 的警告,该警告位于 UITabBar
的参考:
Note that if you are trying to modify a tab bar associated with a UITabBarController
, you should consider this warning from Apple, located in the reference for UITabBar
:
重要提示:在 iOS 3.0 及更高版本中,您不应尝试使用这些方法以及要修改的此类的属性关联时的标签栏一个标签栏控制器对象.修改标签栏以这种方式导致抛出异常.相反,任何修改标签栏或其项目应该通过标签栏出现控制器接口.你可能还直接修改一个标签栏对象不与标签栏关联控制器.
Important: In iOS 3.0 and later, you should not attempt to use the methods and properties of this class to modify the tab bar when it is associated with a tab bar controller object. Modifying the tab bar in this way results in the throwing of an exception. Instead, any modifications to the tab bar or its items should occur through the tab bar controller interface. You may still directly modify a tab bar object that is not associated with a tab bar controller.
这篇关于iPhone - 使标签栏透明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!