
[英]Xamarin.iOS how do I change the status status bar color when there is no Navigation bar
[英]How do I make this iOS navigation bar color change work in the context of a UIPageViewController?
此代码用于在我的初始 viewController 中设置导航栏的颜色。 但是,当我转到嵌入在 UIPageViewController 中的下一个 VC 时,它不会更新。 我已经为 UIPageViewController 本身和它加载的第一个 VC 尝试了 viewDidLoad 中的代码,但都没有更新实际的导航栏颜色(尽管打印 function 运行成功)。
if #available(iOS 15, *) {
let appearance = UINavigationBarAppearance()
print("wlVWA")
appearance.configureWithOpaqueBackground()
appearance.backgroundColor = Colors.colorTitleScheme[1].0
UINavigationBar.appearance().standardAppearance = appearance
UINavigationBar.appearance().scrollEdgeAppearance = appearance
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.