ios - Fullscreen modal makes navigationBar.barStyle not working properly
问题描述
I've uploaded a minimum demo app here: Demo
The problem I am facing is triggered in a very particular flow as below: In the demo app, I have a Level2 viewController with
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
self.navigationController?.navigationBar.barStyle = .default
self.navigationController?.navigationBar.tintColor = .blue
}
and a Level 3 viewController pushed from L2 viewController with
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
self.navigationController?.navigationBar.barStyle = .black
self.navigationController?.navigationBar.tintColor = .white
}
If the navigation is just between L2 and L3, Example flow: rootViewController > L2 > L3 > L2
the status bar style and the bar style always work as expected: Darkmode style in L3 and Lightmode style in L2.
The problem comes only after a modal is presented from L3 viewController with modalPresentationStyle = .fullScreen
The navigation bar on L2 stays grey, seems navigationBar.barStyle = .default
in viewWillAppear doesn't work any more
Example flow: rootViewController > L2 > L3 > full screen modal > L3 > L2
Does anyone know is it possible to make L2 navigation bar style work correctly in this specific flow? Or is that bug? Any workaround?
解决方案
推荐阅读
- spring - 如何在 CXF 的 ContainerRequestFilter 中注入 ResourceInfo
- android - 在android中连接到xmpp服务器
- android - 弹性搜索结果在空格后开始新的搜索
- python-3.x - 如何从套接字(AF_INET6、SOCK_RAW、IPPROTO_ICMPv6)的原始字节串创建 ICMPv6 scapy 对象?
- node.js - 如何以编程方式通过标准输入将变量传递给 cli 命令?
- javascript - 根据 contenteditable Div 中的插入符号位置获取选定元素
- openstack - Devstack中的keystone虚拟配置文件在哪里?
- java - Spring MVC - 为一个集成测试覆盖一个 bean
- vba - 在 .Range 命令中选择带有 r1c1 符号的单个单元格
- d - 函数参数:“ref”关键字或 D 中的指针?