gpt4 book ai didi

swift - 我的 UIViewcontroller 没有填满整个屏幕?

转载 作者:行者123 更新时间:2023-11-30 10:35:45 25 4
gpt4 key购买 nike

我有一个非常简单的应用程序,带有两个 UIviewcontroller。我想驳回一个并提出另一个。但是,当我这样做时(下面的代码),第二个 View Controller 不会填充屏幕,而是悬停在顶部 View Controller 上,如果您从上向下滑动,则很容易被忽略(您可以在顶部)?

VC-1:

@objc private func picksAction(){
print("picks button pressed")

let layout = UICollectionViewFlowLayout()
let viewController = GridPicksCollectionViewController(collectionViewLayout: layout)
let navController = UINavigationController()
navController.pushViewController(viewController, animated: true)
self.present(navController, animated: true) {}

}

结果:enter image description here

最佳答案

设置modalPresentationStyle.fullScreen :

navController.modalPresentationStyle = .fullScreen

关于swift - 我的 UIViewcontroller 没有填满整个屏幕?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58078161/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com