问题
I have a modal view that has a UIToolbar
at the top . In this view I present another modal view. The problem is that when the second view is dismissing the UIToolbar
of the first modal view seems to slide under the app status bar, this does not happen when the firs modal view is presented, only when the second one is dismissed.
Any idea how to fix this?
The view frame changes when the view is redisplayed
2012-12-11 14:53:49.976 app[11225:907] toolbar frame: {{0, 0}, {320, 44}}
2012-12-11 14:53:49.979 app[11225:907] view frame: {{0, 20}, {320, 460}}
2012-12-11 14:54:07.496 app[11225:907] toolbar frame: {{0, 0}, {320, 44}}// here the second modal view is dismissed
2012-12-11 14:54:07.498 app[11225:907] view frame: {{0, 0}, {320, 480}}
The app does not use full-screen ...
The first view controller is just a modal view
[self performSegueWithIdentifier:@"SettingsSegue" sender:self];
the presented views are dismissed when the user taps a button
[self dismissModalViewControllerAnimated:YES];
nothing fancy ... Hmm.. this problem happens when testing on device... it seems to work ok in the simulator
回答1:
Does the view controller you're presenting respond to supportedInterfaceRotations
and shouldAutorotate
incorrectly? When presented modally, it's simpler to just not override those methods at all.
This happened to me - see this question and answer.
来源:https://stackoverflow.com/questions/13788847/uitoolbar-slides-under-status-bar