簡體   English   中英

點擊單元格時如何顯示tableview單元格編輯視圖?

[英]How to show tableview cell edit view when tap the cell?

我的要求是在點擊單元格時顯示tableviewcell編輯視圖。 滑動時“editActionsForRowAtIndexPath”正在工作但我在點擊單元格時需要此操作。 在此輸入圖像描述

我不知道你用什么刷卡。 但是,如果您想在用戶點擊單元格時處理某些操作,則應使用didSelectRowAtIndexPath函數。 例如;

override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
    print("Tapped")
}

在didselect委托方法上使用此代碼,我認為它會對您有所幫助。

self.tableView.editing = true

暫無
暫無

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

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