小编swi*_*123的帖子

不调用tableView(_ tableView:UITableView,didSelectRowAt indexPath:IndexPath)

我的结构如下:

UIViewController -> UIVIew -> UITableView

tableView(_ tableView: UITableView, numberOfRowsInSection section: Int)

tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath)

被称为但是

tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath)

不叫.

class ViewcontrollerA : UIViewController  , UITableViewDelegate , UITableViewDataSource {

    override func viewDidLoad() {
        super.viewDidLoad()

        self.doctortableView.delegate = self
        self.doctortableView.dataSource = self
        self.doctortableView.allowsSelection = true

    }

    func callTable() {

        doctortableView.frame = CGRect(......)
        view1.addSubview(doctortableView)
        doctortableView.isUserInteractionEnabled = true

        self.view.addSubview(view1)

    }

    // Tableview Functions

    // Number of Sections in Table
    func numberOfSections(in tableView: UITableView) -> Int {
        return …
Run Code Online (Sandbox Code Playgroud)

uitableview ios swift

-4
推荐指数
1
解决办法
292
查看次数

标签 统计

ios ×1

swift ×1

uitableview ×1