隐藏 UIAlertView
有没有办法以编程方式隐藏 UIAlertView?我正在我的进度视图中显示进度视图,当进度视图 = 1.0 时,我想隐藏 UIAlertView。
Is there a way to hide the UIAlertView programatically. I am displaying a progress view in mine and when the progress view is = 1.0 I want to hide the UIAlertView.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以做的是观察(使用键值观察)进度视图中的
progress
属性,然后当它达到 1.0 时,将dismissWithClickedButtonIndex:animated:
消息发送到警报看法。What you can do is observe (using key-value observing) the
progress
attribute in your progress view, then when it hits 1.0 send thedismissWithClickedButtonIndex:animated:
message to the alert view.我会使用 UIActionSheet 来执行这种行为。用户被训练手动关闭 UIAlertView,这只会让他们感到困惑。
UIActionSheets 是高度可定制的,可以满足您的任何需求。
I would use a UIActionSheet to do this kind of behavior. The user is trained to manually dismiss the UIAlertView and this would just confuse them.
UIActionSheets are highly customizable to do whatever you need.