简体   繁体   中英

View on View controllers are all square shaped on Xcode 11, how?

视图控制器上的视图是方形的

I have tried to change it's size manually (by dragging) and still not working.

您可以将其内容大小设置为任何您想要的大小。

On iOS 13 a "Modal" segue will show the presenting controller that way by default.

If you want the view controller to occupy the whole screen, set "Full Screen" on the "presentation" setting of any segue entering that controller. Segue Settings

If your view presents programmatically (not via storyBoard), have this in mind: From XCode 11 and up, when you build for iPad you have to add "modalPresentationStyle = .fullScreen" to get full screen views, not square ones. As follows:

let vc = UIViewController()
vc.modalPresentationStyle = .fullScreen 
self.present(vc, animated: true, completion: nil)

If you want transparency on the new viewController, you can write ".overFullScreen", as follows:

let vc = UIViewController()
vc.modalPresentationStyle = .overFullScreen 
self.present(vc, animated: true, completion: nil)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM