0

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?

gdm
  • 7,647
  • 3
  • 41
  • 71

1 Answers1

1

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

Community
  • 1
  • 1
Antonio MG
  • 20,382
  • 3
  • 43
  • 62
  • It is indeed, by default in iOS7 views fill the whole screen, so you need to tell it that you dont want your view to be resized – Antonio MG Oct 25 '13 at 08:12