statusBarFrame = 0 after stacked presentViewController

萝らか妹 提交于 2019-12-07 09:08:48

问题


  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:


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).



来源:https://stackoverflow.com/questions/13349018/statusbarframe-0-after-stacked-presentviewcontroller

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!