我尝试根据Apple文档将modalPresentationStyle
设置为.fullscreen。
在将下面的代码中显示的modalPresentationStyle
设置为.fullscreen
之后,系统仍然在UIModalPresentationStyle.automatic
“系统默认值”中显示viewControllers
//Presentation Style
let homeVC = HomeController(viewModel: viewModel)
homeVC.modalPresentationStyle = UIModalPresentationStyle.fullScreen
一个名为XCoordinator的框架控制此应用程序内的导航,这是有关如何完成此操作的示例。
switch route {
case .home:
let viewModel = HomeViewModelImpl(router: anyRouter)
let viewController = HomeController(viewModel: viewModel)
return .push(viewController)
}
[X0设置XCoordinator时,TabBarCoordinator
具有rootViewController。
这里的解决方案是将.modalPresentationStyle
的.fullscreen
设置为rootViewController
。
rootViewController.modalPresentationStyle = .fullscreen
请注意必须在类文件中的任何super
方法之后调用此>]