Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IOS Ignoring ModalPresentationStyle and ModalTransitionStyle and presenting fullscreen

Tags:

ios

ipad

My App is completely ignoring UIModalPresentationFormSheet and UIModalTransitionStyleCrossDissolve. It is always popping up fullscreen and with the default transition.

It does it on my real app. I then made a blank test app, and it does the same thing.

It is quite simple: My AppDelegate loads KBViewController as the root view. KBViewController tries to present a blank view controller (KBModalViewController). The view in KBModalViewController.xib is set to the "FormSheet" Size

My View Controller:

@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];
}

I am using Xcode 4.61. I have compiled to ipad 5.1, ipad 6.1, and a real ipad 2 on 6.1. Same on all.

like image 750
user1560196 Avatar asked Jun 27 '13 11:06

user1560196


1 Answers

Try..

@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];
    }
like image 83
Sunny Shah Avatar answered Nov 28 '22 00:11

Sunny Shah