在 UIPopoverController 中关闭 UIActionSheet 后出现 UI 问题

发布于 2024-10-06 19:42:53 字数 877 浏览 0 评论 0原文

我在 UIPopoverController 中特定使用 UIActionSheet 时遇到问题。这似乎是苹果的一个错误,但我想先检查一下这里,以确保我没有遗漏什么。重现问题的条件非常具体,因此我创建了一个重现问题的小应用程序。您可以在此处下载

该问题在以下条件下发生:

  • UIPopoverController 包含 UINavigationController。
  • 在 UINavigationController 上调用了 setToolbarHidden: 方法来显示工具栏,但在显示 UIActionSheet 时工具栏处于隐藏状态。

一旦 UIActionSheet 显示并关闭,导航控制器就会调整大小,就好像工具栏应该显示在其下方(或者可能就是工具栏?)。在 -(void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex 中调用 setToolbarHidden:YES 没有帮助。

您可以通过下载上面的项目,在 iPad 模拟器 (iOS4.2) 中纵向运行它,然后在 UIPopoverController 中点击“Tap Me”来重现该问题。一旦 UIAlertView 被关闭,您就会看到问题。下面是一个屏幕截图。

有什么想法吗?谢谢。

替代文字

I'm having a problem with a specific use of a UIActionSheet within a UIPopoverController. It seems to be an Apple bug, but I wanted to check here first to make sure I'm not missing something. The conditions to reproduce the problem are quite specific, so I've created a small app that reproduces the problem. You can download that here.

The problem happens under the following conditions:

  • A UIPopoverController contains a UINavigationController.
  • The setToolbarHidden: method has been called on the UINavigationController to show the toolbar, but the toolbar is in a hidden state when displaying the UIActionSheet.

Once the UIActionSheet is displayed and dismissed, the navigation controller gets resized as if a toolbar should be displayed below it (or perhaps it is the toolbar?). Calling setToolbarHidden:YES in -(void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex doesn't help.

You can reproduce the problem by downloading the project above, running it in the iPad simulator (iOS4.2) in portrait orientation, and tapping "Tap Me" in the UIPopoverController. Once the UIAlertView is dismissed you'll see the problem. Below is a screenshot.

Any ideas? Thanks.

alt text

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文