有什么方法可以防止UIActionSheet在用户单击其中的按钮时被解雇? [英] Any way to prevent UIActionSheet from being dismissed when user clicks a button in it?
问题描述
我在 UIActionSheet
中添加了 UIProgressView
来指示下载进度。因此,当用户单击其中的 download 按钮时,我不希望我的 UIActionSheet
被关闭。
I added a UIProgressView
to my UIActionSheet
to indicate the download progress. So I do not want my UIActionSheet
to be dismissed when user click the download button in it.
但是有办法吗?
现在,我实现了 didDismissWithButtonIndex 委托方法,以在显示 UIActionSheet
后再次显示它。但是我希望有更好的方法。
Right now I implement didDismissWithButtonIndex delegate method to show UIActionSheet
again after it was dismissed. But I was hoping there is a better way.
推荐答案
UIActionSheet
是模态视图,这意味着它完全阻止了UI。由于阻止UI被认为是一种不好的做法,因此不支持防止删除操作表。相反,您应该在操作表之外制作一个完全独立的进度指示器。
UIActionSheet
is a modal view, which means that it blocks UI completely. Since blocking UI is considered a bad practice, preventing an action sheet from dismissing is not supported. Instead, you should make a completely separate progress indicator outside the action sheet.
这篇关于有什么方法可以防止UIActionSheet在用户单击其中的按钮时被解雇?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!