【问题标题】:Presenting the ViewController in full screen全屏显示 ViewController
【发布时间】:2020-07-21 10:51:40
【问题描述】:

我在按钮操作中展示了一个视图控制器,如下所示,

PromptController *obj = [[[PromptController alloc]initWithNibName:@"PromptController" bundle:nil]autorelease];
UINavigationController *navigation = [[[UINavigationController alloc]initWithRootViewController:obj]autorelease];    
[self presentViewController:navigation animated:YES completion:nil];
[AVSession stopRunning];

但它没有在手机的全屏上显示。它呈现如下

如何全屏呈现。非常感谢任何帮助

【问题讨论】:

    标签: ios objective-c viewcontroller ios13 presentviewcontroller


    【解决方案1】:

    在 iOS 13 中,默认演示样式已更改。如果你想要 iOS 12 的演示风格,你可以将modalPresentationStyle 更改为.fullScreen。

    斯威夫特版本

    navigation.modalPresentationStyle = .fullScreen
    

    目标 C

    navigation.modalPresentationStyle = UIModalPresentationOverFullScreen;
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-09-06
      相关资源
      最近更新 更多