statusBarFrame = 0 after stacked presentViewContro

2019-05-04 14:57发布

  1. My main view controller calls presentViewController to display a configuration screen.
  2. A button on that configuration screen calls presentViewController to allow the user to select a photo.
  3. Once the second view controller is dismissed, the first view controller is redrawn under the status bar on iOS 6 (works fine on iOS 5).

In the viewWillAppear method of the first config controller (the one modally presented) I tried a couple things:

  • Checking the statusBarFrame (it returns 20 on first view; 20 on following views)
  • Checking the main screen's frame (it returns {{0, 20}, {320, 460}} on first view, {0, 0} on following views)
  • Manually setting the y coordinate of the frame to 20 (iOS changes it back to 0 even though the autoresizing mask is set to none)

At this point I can't think of anything except manually moving all the subviews down 20 pixels, which is super janky. Any thoughts as to what might be causing this?

What has changed in iOS 6 that might cause this?

1条回答
孤傲高冷的网名
2楼-- · 2019-05-04 15:36

I'm not sure why, but this was fixed by removing the iOS 6 rotation methods, which were unused since the app is portrait-only (shouldAutorotate and supportedInterfaceOrientations).

查看更多
登录 后发表回答