Question

I present an UIViewController once by pushing it into a navigationcontroller, and another time by init the root view of a navigation controller.

FIRST CASE: AS SECOND SLIDE OF A NAVIGATION CONTROLLER

 [self.navigationController pushViewController:riassunto animated:YES];

SECOND CASE: AS ROOT OF MODAL VIEW

   UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:riassunto];

        navigationController.navigationBarHidden     = NO;
        [[navigationController navigationBar] setBarStyle:UIBarStyleBlack];
        [self presentViewController:navigationController animated:NO completion:nil];

But the position of the view is different:

FIRST CASE

enter image description here

SECOND CASE

enter image description here

It seems that in the second case, modal view, the view does not move down to make room to the top bar. Why?

Was it helpful?

Solution

Try using this in your second view controller:

riassunto.edgesForExtendedLayout = UIRectEdgeNone;

For more info, I'm extending this answer:

https://stackoverflow.com/a/19585104/550034

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top