[英]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.