我希望其中一个选项在单击时不执行任何操作。它基本上是一个占位符。它没有标题,而且只是白色的。
func actionSheet(sheet: UIActionSheet, clickedButtonAtIndex buttonIndex: Int) {
if sheet.tag == 1 {
var title = sheet.buttonTitleAtIndex(buttonIndex)
if title == Constants.EmptyTitleActionSheetItem{
//do nothing. don't dismiss.
}else{
//something real was clicked. perform actions and continue dismissal
}
}
}
最佳答案
我看到有 2 个选择。
- 正如我在上面的评论中提到的,我认为被解雇是不可能避免的。另一种解决方案是,当您点击需要“不要关闭”的按钮时,您可以使用 animate = FALSE 再次显示操作表。
- 您可以构建自己的actionSheet或使用第三方开源库。
关于ios - 如何使 ActionSheet 单元格在单击时不关闭?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29643587/