开发者

How to shift navigation bar position on the screen

I have added the following code in my app delegate to create a section below the status bar (as seen in the screenshot after the code)

UIWindow *statusWindow = [[UIWindow alloc] initWithFrame:CGRectMake(0, 20, 320, 20)];
statusWindow.windowLevel = UIWindowLevelStatusBar;
statusWindow.hidden = NO;
statusWindow.background开发者_如何转开发Color = [UIColor colorWithWhite:0.0 alpha:0.7];
[statusWindow makeKeyAndVisible];

How to shift navigation bar position on the screen

How can I shift the navigation bar downwards so that the black overlay does not overlap with the navigation bar? Essentially, I would like to achieve an effect like that in the screenshot below:

How to shift navigation bar position on the screen

Any advise or resources on this will be greatly appreciated.


There's some advice on this topic here, but one of the comments does point out that you shouldn't really mess with the Navigation Bar directly - worth checking the Apple guidelines to make sure your app isn't going to be rejected out of hand.


Change the NavigationController's frame property. Though you should listen to Xav, he speaks the truth. Apple will likely give you the stink eye and put your app in the slow lane of infinite rejection.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜