Table View Cell Row Height doesnt work

前端 未结 8 1050
故里飘歌
故里飘歌 2021-02-05 03:39

I have tried to hard code the row height in the table view cell. After running the program it looks like only one line. I suspect it is because of the height of the row

8条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-05 03:57

    1. Set number of lines to 0
    2. Set
       yourTableView.rowHeight = UITableView.automaticDimension and 
       yourTableView.estimatedRowHeight =  UITableView.automaticDimension
    
    1. return UITableView.automaticDimension in tableView(_:heightForRowAt:) delegate method

    2. Set all constraints . Bottom constraint is important to increase table view cell height .

    Your all set to go

提交回复
热议问题