UITableViewCell not showing detailTextLabel.text - Swift

前端 未结 11 2407
慢半拍i
慢半拍i 2020-12-14 06:45

The detail (subtitle) text does not appear. The data are available, though, because when a println() call is added, it prints Optional(\"data\") to the console with the expe

11条回答
  •  甜味超标
    2020-12-14 07:04

    xcode 11

    override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        //        let cell = tableView.dequeueReusableCell(withIdentifier: "reuseIdentifier", for: indexPath)
        let cell = UITableViewCell(style: UITableViewCell.CellStyle.value1, reuseIdentifier: "reuseIdentifier")
        cell.detailTextLabel?.text = "Detail text"
        cell.textLabel?.text = "Label text"
    
        // Configure the cell...
    
        return cell
    }
    

提交回复
热议问题