开发者

UINavigationController Offset

I have a UINavigationController which appears at an offset of 20px. This is the exact problem I'm having: http://forums.macrumors.com/showthre开发者_StackOverflow社区ad.php?t=761616 But I can't seem to figure out what the right way to solve it is.

Thanks,


After I searched the possible way to solve, people said it should be shifted 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];

It works fine for me now, good luck~ :)


The solution to this problem is setting splitviewcontroller's frame to [[UIScreen mainScreen] bounds]; e.g

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


Make sure the frame is set at (0,0). It probably has that space because you add 20px to the Y position to make up for the status bar, but that is already handled for us.


Have you added a status bar as your top bar from Interface Builder?. May be you have kept space for status bar.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜