简体   繁体   English

为什么UIModalPresentationPageSheet不起作用…始终全屏显示

[英]Why UIModalPresentationPageSheet not working … its always fullscreen

Here is the code snippet for presenting view controllers as Form sheet.Its not working 这是用于将视图控制器显示为表单的代码片段。

It always comes as full screen 它总是以全屏显示

UIStoryboard *sb = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
    UIViewController *vc = [sb instantiateViewControllerWithIdentifier:@"ViewController2"];
    vc.modalPresentationStyle = UIModalPresentationFormSheet;

    [self presentViewController:vc animated:YES completion:NULL];

I even tried ... preferred content size not works... 我什至尝试过...首选内容大小不起作用...

I think you are trying in iPhone. 我认为您正在尝试使用iPhone。

Try this in iPad. 在iPad中尝试一下。

In iPhone its always full screen. 在iPhone中,它始终是全屏的。

In iPad it will look as formsheet as per your expectation 在iPad中,它会按照您的期望显示为表格

If you want this to work in iPhone you have to try a third party library or do it yourself 如果要在iPhone中使用此功能,则必须尝试第三方库或自己做

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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