IOS忽略ModalPresentationStyle和ModalTransitionStyle并呈现全屏

use*_*196 4 ipad ios

我的应用程序完全忽略了UIModalPresentationFormSheet和U​​IModalTransitionStyleCrossDissolve.它始终弹出全屏并具有默认转换.

它在我的真实应用程序上完成.然后,我做了一个空白测试应用程序,它做了同样的事情.

这很简单:我的AppDelegate加载KBViewController作为根视图.KBViewController尝试呈现一个空白视图控制器(KBModalViewController).KBModalViewController.xib中的视图设置为"FormSheet"大小

我的视图控制器:

@implementation KBViewController


-(void)viewDidAppear:(BOOL)animated{
    [self setModalPresentationStyle:UIModalPresentationFormSheet];
    [self setModalTransitionStyle:UIModalTransitionStyleCrossDissolve];
    KBModalViewController *m = [[KBModalViewController alloc] initWithNibName:nil bundle:nil];
    [self presentViewController:m animated:YES completion:nil];

    //Also tried the depreciated presentModalViewController, same result
    //[self presentModalViewController:m animated:YES];
}
Run Code Online (Sandbox Code Playgroud)

我正在使用Xcode 4.61.我已经编译成ipad 5.1,ipad 6.1和6.1上的真正的ipad 2.总而言之.

Sun*_*hah 7

尝试..

@implementation KBViewController


    -(void)viewDidAppear:(BOOL)animated{

        KBModalViewController *m = [[KBModalViewController alloc] initWithNibName:nil bundle:nil];
        [m setModalPresentationStyle:UIModalPresentationFormSheet];
         [m setModalTransitionStyle:UIModalTransitionStyleCrossDissolve];
        [self presentViewController:m animated:YES completion:nil];

        //Also tried the depreciated presentModalViewController, same result
        //[self presentModalViewController:m animated:YES];
    }
Run Code Online (Sandbox Code Playgroud)