iPhone:UITabBarController 内的半透明导航栏

标签 iphone ios uitabbarcontroller uinavigationbar

在这里。 我在 UITabBarController 中有一个 UINavigationController。 有没有办法设置导航栏半透明? 我尝试以编程方式将其设置为:

navigationController.navigationBar.translucent = YES;

但没有任何变化。 我什至尝试记录半透明值,它实际上是 YES,但栏仍然完全不透明。 导航栏后面的 View 覆盖了整个屏幕,我什至可以在(半透明)状态栏下看到它。我真的不明白。 所有这一切只有在导航 Controller 位于标签栏 Controller 内时才会发生。

编辑: 你猜怎么了?是 xcode 搞砸了我的 nib 文件... 我从头开始重新创建了 xib,它按预期工作。 还是谢谢

最佳答案

您设置了错误的属性:

self.navigationController.navigationBar.barStyle = UIBarStyleBlackTranslucent;

关于iPhone:UITabBarController 内的半透明导航栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6785220/

相关文章:

iphone - HTML5 视频通话,可能吗?

iphone - 分隔线之前的空白进入我的 TableView

iphone - 我如何在 iPhone 的 tableview 中的特定行显示传入消息

ios - 未安装分发证书/私钥

UITabBarController 的 iOS 状态恢复不恢复 subview Controller 或选定索引

iphone - 企业 iPad 应用程序分发

iphone - 为什么我的 NSNumber 总是零?

ios - swift 5 : Binary operator '==' cannot be applied to operands of type 'AnyObject?' and 'UIView?'

swift - 以编程方式更改 UITabBarView 选项卡顺序

ios - 按下自定义 UITabBarController 上的按钮时显示用户位置