堆叠的presentViewController之后statusBarFrame = 0 [英] statusBarFrame = 0 after stacked presentViewController

查看:256
本文介绍了堆叠的presentViewController之后statusBarFrame = 0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


  1. 我的主视图控制器调用 presentViewController 来显示配置屏幕。

  2. 一个按钮配置屏幕调用 presentViewController 以允许用户选择照片。

  3. 一旦第二个视图控制器被解除,第一个视图控制器就是在iOS 6上的状态栏下重绘(在iOS 5上正常工作)。

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

在第一个配置控制器的viewWillAppear方法中(一个模态呈现)我尝试了几件事:

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


  • 检查statusBarFrame(它返回 20 在第一个视图上; 20 在以下视图上)

  • 检查主屏幕的框架(它返回 {第一个视图中的{0,20},{320,460}} ,以下视图中的 {0,0}

  • 手动将框架的y坐标设置为20(即使自动调整遮罩设置为无,iOS也会将其更改回0)

  • 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这一点我想不出任何事情,除了手动将所有子视图向下移动20像素,这是超级janky。关于可能导致这种情况的任何想法?

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?

iOS 6中可能导致这种情况发生了什么变化?

What has changed in iOS 6 that might cause this?

推荐答案

我不知道为什么,但这是通过删除iOS 6轮换方法来解决的,因为应用程序仅限于纵向(shouldAutorotate和supportedInterfaceOrientations),因此未使用这些方法。

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

这篇关于堆叠的presentViewController之后statusBarFrame = 0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆