I am new in swift and I am trying to create a school project. The problem I face is I have multiple cells and I don't know how to increase the cell height. I have searched, but I am not able to understand how to do it.
Thanks for help in advance.
Asked
Active
Viewed 482 times
0

pfx
- 20,323
- 43
- 37
- 57

Stanley J Behling
- 21
- 1
-
The better approach is to make use of auto layout and `UITableView`'s "estimated" support - See [Self-sizing Table View Cells](https://www.raywenderlich.com/1067-self-sizing-table-view-cells) for starters – MadProgrammer Sep 04 '18 at 20:33
-
Possible duplicate [Using Auto Layout in UITableView for dynamic cell layouts & variable row heights](https://stackoverflow.com/questions/18746929/using-auto-layout-in-uitableview-for-dynamic-cell-layouts-variable-row-heights) and [UITableViewCell auto height based on amount of UILabel text](https://stackoverflow.com/questions/42717173/uitableviewcell-auto-height-based-on-amount-of-uilabel-text/42717313) – MadProgrammer Sep 04 '18 at 20:34
1 Answers
-1
Implement the following table view method:
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
//return the size of your cell
}
Like if your cell height is 190 then simply return 190 here.

rmaddy
- 314,917
- 42
- 532
- 579

Saurabh Pathak
- 14
- 4