簡體   English   中英

如何為uitableviewcell的內表調用didselectrow方法

[英]how to call didselectrow method for inner table of uitableviewcell

我在 tableviewcell 中使用 tableview1,當單擊 tableviewcell 的 tableview1 時它出現在主 tableview 上,當我選擇 tableview1 cell 時它選擇主 tableview 為什么?

在 didselectrow func 中注冊您的 UItableVIewcell,然后在 didselectrow func 中添加條件,如下所示

let cell = tableView.dequeueReusableCell(withIdentifier: bandCellId, for: indexPath) as! UITableViewCell // your cellview name

    if tableView == cell.tableview1
    {
        // do something for tableview1
    }
    else
    {
        //  do something for maintableview

    }

希望這可以幫助你。

暫無
暫無

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

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