[英]When the UITabbar is Translucent and the UIViewController is not extended behind the tabbar, the uitabbar seems like covering a black view
第一个视图中的标签栏就是我想要的。 因为第二个视图不是滚动视图,所以我无法使用self.edgesForExtendedLayout = UIRectEdge.Bottom
将其扩展到底self.edgesForExtendedLayout = UIRectEdge.Bottom
。
这看起来令人无法接受。
而且我不想将uluabbar的Translucent
设置为false
,这不是花哨的。
我试着用另一种方式: [[UITabBar appearance] setBarTintColor: [UIColor whiteColor]];
它不起作用。 为了使它看起来更清晰,我将颜色更改为红色。 最后一个标签栏看起来也像是覆盖了一些黑色视图。
我会说在viewController的viewDidLoad
中添加此代码将解决您的问题:
edgesForExtendedLayout = .all
extendedLayoutIncludesOpaqueBars = true
另外,您可以将tabBar
半透明状态而不设置任何背景颜色。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.