UIToolbar 在状态栏下滑动 [英] UIToolbar slides under status bar

查看:24
本文介绍了UIToolbar 在状态栏下滑动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个模态视图,顶部有一个 UIToolbar .在这个视图中,我提出了另一个模态视图.问题是,当第二个视图解除第一个模态视图的 UIToolbar 似乎在应用程序状态栏下滑动时,当第一个模态视图出现时不会发生这种情况,只有当第二个视图出现时被解雇了.

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

推荐答案

您呈现的视图控制器是否错误地响应 supportedInterfaceRotationsshouldAutorotate?当以模态呈现时,根本不覆盖这些方法会更简单.

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.

这篇关于UIToolbar 在状态栏下滑动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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