【问题标题】:Objective c How to set orientation to landscape in ios13Objective c 如何在ios13中将方向设置为横向
【发布时间】:2019-10-02 04:09:54
【问题描述】:

我的代码适用于除 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 objective-c iphone


    【解决方案1】:

    在 ios 13 中,默认 modalpresentaionstyle 是 'fromsheet',而不是 'fullscreen',不像以前的版本。您应该将控制器的 modalpresentaionstyle 设置为“UImodalPresentaionFullscreen”,例如“control.modalPresentationStyle = UIModalPresentationFullScreen;”。

    【讨论】:

      猜你喜欢
      • 2019-06-18
      • 1970-01-01
      • 1970-01-01
      • 2013-10-08
      • 2017-02-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多