iPhone: Presenting Modal View Shifts Views of Calling ViewController
I have two view controllers myViewControl开发者_如何学编程lerA and myViewControllerB.
myViewControllerA has modalTransitionStyle = UIModalTransitionStyleFlipHorizontal
.
Then I call presentModalViewController:animated:
to load myViewControllerB. After calling dismissModalViewControllerAnimated:
, suddenly all the views of myViewControllerA display shifted up by the height of the status bar.When I repeat the process, the views of myViewControllerA display properly once more.
So, the problems appears only upon the first call of the modal view controller. After dismissing and calling it again everything looks fine again.
What can cause this?
I know this is an old question, but it could still be helpful to someone. The solution is so simple, its easy to pass it.
When you remove the simulated status bar of that view in Interface Builder, the frame still has a height of 460 (it should be 480, the height of the iphone screen)
Go to the Size tab (ruler icon), in the Attributes inspector, and set the frame to 480 again.
精彩评论