问题描述
任何人都可以帮助我防止在其按钮点击事件中关闭 alertview 吗?
Can anyone help me in preventing dismissal of alertview on its button click event??
我有一个 textview 作为我的 alertView 的子视图,如果 textview 的值为 nil,我不想关闭它.
I have a textview as a subview of my alertView and i dont want to dismiss it if textview's value is nil.
推荐答案
这可能违反 HIG 指南,即不关闭 UIAlertView.
That might be against HIG Guidelines to NOT to dismiss an UIAlertView.
解决方法:我不知道您的应用程序中发生了什么,但要实现此目的,您可以做的是关闭 AlertView,然后检查是否设置了 textView 的文本.如果设置为nil,则再次调出alertview!
WORKAROUND : I don't know what goes on in your app, but to acheive this thing, what you could do is dismiss the AlertView and then check if textView's text is set or not. If it is set to nil, then bring up the alertview again!
这篇关于防止 AlertView 关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!