开发者

When dismissing modal view controller, all main view contents moves up by 20px

开发者 https://www.devze.com 2022-12-27 15:47 出处:网络
I am using presentModalViewController: and dismissModalViewController: with animation set to YES in both cases, which works fine.

I am using presentModalViewController: and dismissModalViewController: with animation set to YES in both cases, which works fine.

However, after the modal view is dismissed, all of the content on the main view has moved u开发者_JS百科p what looks like 20px. This affects all the view controllers.

Any idea why this happens, and how to overcome it?


Have you messed with your views' autoresize mask. Also, are you hiding the status bar? If both are true, then this is the problem.


Did you use any tabbar in your application? I have similar problem see this post,

iPad modalPresentationStyle UIModalPresentationFormSheet orientation problem

Is this app full screen?

if yes, You may try re-hiding the status bar in viewWillAppear or viewWillDisappear on the modal view controller.

[[UIApplication sharedApplication] setStatusBarHidden:YES animated:NO];


This could have a few reasons, can you be more specific.

Possible Causes: Do you hide your status bar in one of the ViewController? Do you have a translucent NavigationBar in one of the views and a non translucent NavigationBar in the other?

0

精彩评论

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

关注公众号