当应用程序转到后台并返回前台时,UIAlertView 消失
我正在开发一个 iPhone 应用程序(支持多任务的 iPhone),其中显示 UIAlertView 错误。当 UIAlertView 即将显示时,我的应用程序被发送到后台。现在,如果我尝试让我的应用程序进入前台,UIAlertView 会显示一会儿并自动关闭,即使我不调用关闭/单击任何按钮也是如此。
有谁知道问题是什么?
谢谢和问候, 迪帕
I am developing an iPhone application (iPhone with multi tasking support) in which I am displaying UIAlertView on error. When UIAlertView is about to get display my app is sent to background. Now, if I try to get my app in the foreground, UIAlertView gets displayed for a moment and gets dismissed automatically even if I don't call dismiss/click on any button.
Does anyone knows what the problem is?
Thanks and Regards,
Deepa
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当您添加警报视图时,它会添加到当前视图控制器的视图之上,并且在返回前台时,有时会从 xib 重新加载视图并刷新所有内容。我建议您在控制器中维护一个状态变量,该变量在返回前台时再次调用alertView。
When you add an alert view, it is added on top of the view of the current viewcontroller and while coming back to foreground , sometimes the view is reloaded from the xib and all the contents are refreshed. I suggest you to maintain a state variable in controller which calls the alertView again when coming back to foreground.
Rajact 的答案很好,如果“呼叫”意味着下一个,
这对我有用
我希望这对某人有帮助
Rajact answer is good if by 'call' means the next
This worked for me
I hope this helps someone