Set TableView height by the number or rows

前端 未结 9 1586
不思量自难忘°
不思量自难忘° 2021-01-31 10:40

I have got TableView in the MainstoryBoard and the number of rows is random every time. I want the height of the whole TableView to be fl

9条回答
  •  再見小時候
    2021-01-31 11:24

    Take outlet of tableview height and set it with your tableview row height in cellForRowAt like this,

    tableviewHeight.constant = (tableView.contentSize.height * no_of_rows) + bottom_space

提交回复
热议问题