Why is detailTextLabel not visible?

后端 未结 6 2217
醉酒成梦
醉酒成梦 2020-12-05 09:30

detailTextLabel is not visible (code below). Can you tell me why?

 // Customize the appearance of table view cells.
 - (UITableViewCell *)ta         


        
6条回答
  •  情歌与酒
    2020-12-05 09:47

    I have used this and it worked for me:

    // programming mark ----- ----- ---- ----- ----- ---- ----- ----- ----
    
    func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
        let CellIdentifier: String = "CellIdentifier"
    
        var cell = tableView.dequeueReusableCellWithIdentifier(CellIdentifier) as? UITableViewCell
    
        if cell == nil {
            cell = UITableViewCell(style: UITableViewCellStyle.Value1, reuseIdentifier: CellIdentifier)
        }
    
        cell!.textLabel!.text = "Title"
        cell!.detailTextLabel!.text = "Value"
    
        return cell!
    }
    

提交回复
热议问题