簡體   English   中英

EditActionsforRow:以編程方式關閉

[英]EditActionsforRow: Close Programmatically

我正在努力在我的表視圖中實現一些自定義操作。 目前,我已在以下代碼中創建了一個自定義操作。

override func tableView(tableView: UITableView, editActionsForRowAtIndexPath indexPath: NSIndexPath) -> [AnyObject]? {

//my custom report Action
            var reportAction = UITableViewRowAction(style: UITableViewRowActionStyle.Normal, title: "report problem with product") { (myaction, indexPath) -> Void in
                println(myaction)

                println(indexPath)

//Close the action programmaticaly


            }
            reportAction.backgroundColor = UIColor.purpleColor()


            return [reportAction]

執行完該動作后,向左滑動。 正確顯示帶有“產品報告問題”的紫色標簽

問題在於,似乎無法以編程方式使表格單元格滑回常規表格視圖。 因此,它卡在了下面的屏幕上。

在此處輸入圖片說明 有任何想法嗎?

您要跑步。

tableView.setEditing(false, animated: true)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM