iOS: UITableView cells with multiple lines?

后端 未结 5 1379
既然无缘
既然无缘 2020-12-23 21:42

What\'s the best way to have UITableView cells with multiple lines ? Let\'s say 5.. or 6 ?

Instead of textLabel and la detailTextLabel ? Should I create a custom sty

5条回答
  •  北海茫月
    2020-12-23 22:06

    cell.textLabel.numberOfLines = 0
    

    together with

    tableView.rowHeight = UITableView.automaticDimension
    

    Does work but only if the number of lines is limited (2-3 lines).

    What I had to do as well was embed the cell fields in a StackView. That made all the difference. Now I can display as many lines as I want.

提交回复
热议问题