[英]How to dismiss the actionsheet in tableviewcell when i tap on the view in ios
[英]How can I make an ActionSheet cell not dismiss when clicked?
我希望其中一個選項在單擊時不執行任何操作。 它基本上是一個占位符。 它沒有標題,只是白色。
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個選擇。
唯一的選擇是create a custom
或使用third party
第三方行動表如下:
JGActionSheet-適用於iOS的功能豐富且現代的操作表。
AHKActionSheet-具有基於塊的API和可自定義外觀的UIActionSheet替代品。 受Spotify應用啟發。 實時顯示效果比在GIF上要好得多(由於壓縮)。
將return語句放在該if塊中。
if title == Constants.EmptyTitleActionSheetItem{
//do nothing. don't dismiss.
return;
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.