• 首页 首页 icon
  • 工具库 工具库 icon
    • IP查询 IP查询 icon
  • 内容库 内容库 icon
    • 快讯库 快讯库 icon
    • 精品库 精品库 icon
    • 问答库 问答库 icon
  • 更多 更多 icon
    • 服务条款 服务条款 icon

[UIAlertView 显示] 是工作的?

用户头像
it1352
帮助1

问题说明

我想做一些类似于 UIAlertView 的事情,即 - 不参考任何 UIView 或 UIViewController,使用 presentModalViewController 在所有窗口之上呈现一个 UIViewController.

I want to do something similar to UIAlertView, ie - without reference to any UIView or UIViewController, present a UIViewController on top of all windows using presentModalViewController.

查看文档我找不到可行的方法!

Looking at the documentation I can't find a way in which this is possible!

在 OS4 中,有这样的东西:

In OS4, there is something like this:

UIWindow *window = [UIApplication sharedApplication].keyWindow
UIViewController *rootViewController = window.rootViewController

...但这在 OS3 中是不可能的.

...but this is not possible in OS3.

有谁知道如何在OS3中实现同样的效果?

Does anyone know how to achieve the same effect in OS3?

谢谢!

好的 - 所以我通过无数对 ViewController 本身的委托回调解决了这个问题!虽然这是实现这一目标的正确方法,但似乎有点奇怪,因为在执行的任何阶段都不可能获得顶部视图控制器的句柄以获取警报(等).

OK - so I solved this with a myriad of delegate callbacks to the ViewController itself! Although it's the proper way to achieve this, it did seem kind-of odd that's it's not possible at any stage in execution get a handle to the top View Controller for alerts (etc).

如果有人知道如何实现这一点,我仍然很感兴趣!

If anyone knows how to achieve this, I'd be still really interested!

正确答案

#1

UIAlertView 在应用程序的主窗口上方创建自己的 UIWindowmakeKeyAndVisible-s 它,并在该窗口中自己的视图中设置动画.

UIAlertView creates its own UIWindow above your application's main window, makeKeyAndVisible-s it, and animates in its own views in that window.

这篇好文章是转载于:学新通技术网

  • 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
  • 本站站名: 学新通技术网
  • 本文地址: /reply/detail/tanhcfhggh
系列文章
更多 icon
同类精品
更多 icon
继续加载