Вид заголовка не отображается в разделе 0 - PullRequest
0 голосов
/ 23 апреля 2020

Я добавляю пользовательский заголовок tableView. Мой счетчик разделов равен 2, а заголовок не отображается в разделе 0. Но отображается правильно в разделе 1.

 func numberOfSections(in tableView: UITableView) -> Int {
        return arrRouteDetials.count
    }

    func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
        if section == 0 {
            headerRadioBtn.tag = section
            headerRadioBtn.addTarget(self, action:#selector(RdAction(_sender: )), for: .touchUpInside)

            return viewTblHeader
        }else{
            headerRadioBtn.tag = section
            headerRadioBtn.addTarget(self, action:#selector(RdAction(_sender: )), for: .touchUpInside)

            return viewTblHeader
        }
    }

    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return arrOfSectionRowValue[section].count
    }

    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCell(withIdentifier: "BranchUnloadingcell", for: indexPath) as! BranchUnloadingcell
        cell.lblSerialNo.text = "\(indexPath.row + 1)"
        cell.val = arrOfSectionRowValue[indexPath.section][indexPath.row]
        return cell
    }

    func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) {
        self.viewWillLayoutSubviews()
    }

    func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
        return 74
    }

enter image description here

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...