UINavigationController Offset

I have a UINavigationController that appears with an offset of 20 pixels. This is the exact problem I am facing: http://forums.macrumors.com/showthread.php?t=761616 But I cannot figure out how to solve it correctly.

Thanks,

+4
source share
4 answers

After I looked at a possible solution, people said that it should be offset by 20 pixels programmatically. Here is my solution:

// adjust the frame of subview which is going to be add self.navController.view.frame = CGRectMake(0, 0, 320, 460); [self.view addSubView:self.navController.view]; 

Now it works great for me, good luck ~ :)

+2
source

The solution to this problem is to set the splitviewcontroller framework to [[UIScreen mainScreen] bounds]; eg

 self.mSplitViewC.view.frame = [[UIScreen mainScreen] bounds]; 
+1
source

Make sure the frame is set to (0,0). This is probably space because you add 20 pixels to the Y position to compensate for the status bar, but this is already being processed for us.

0
source

Have you added the status bar as the top bar from Interface Builder ?. You may have saved space for the status bar.

0
source

Source: https://habr.com/ru/post/1314802/


All Articles