![](/img/trans.png)
[英]Screen Orientation for Portrait and Landscape Orientation in iOS (Objective-C)
[英]Objective c How to set orientation to landscape in ios13
我的代码适用于除 13 之外的版本。但在版本 13 中,该代码不适用于横向方向。 我的代码如下。
#if __IPHONE_OS_VERSION_MAX_ALLOWED < 90000
- (NSUInteger)supportedInterfaceOrientations
#else
- (UIInterfaceOrientationMask)supportedInterfaceOrientations
#endif
{
NSLog(@"Mask Orientaion begin");
return UIInterfaceOrientationMaskLandscapeRight;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
NSLog(@"Orientaion begin");
return UIInterfaceOrientationLandscapeRight;
}
请帮我。 谢谢
在 ios 13 中,默认 modalpresentaionstyle 是 'fromsheet',而不是 'fullscreen' 不像以前的版本。 您应该将 controller 的 modalpresentaionstyle 设置为“UImodalPresentaionFullscreen”,例如“control.modalPresentationStyle = UIModalPresentationFullScreen;”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.