0

Let's say I have a scroll view that contains a number of subviews. One of these subviews is a table view, and since I already have a scrolling scroll view, I don't want my table view to scroll. I set isScrollEnabled = false, and I set my table view's top constraint to some other view in the scroll view, and its bottom constraint to the scroll view's bottom anchor. However, this setup causes the table view to be displayed with a height of 0.

Normally I would just set the height of the table view to be the height of each cell * number of cells. However, the height of each cell is also variable, so this will not be possible.

Kevin2566
  • 425
  • 8
  • 20
  • Have a look at this https://stackoverflow.com/a/55006880/1244597, or sample project https://github.com/r-aamir/AutolayoutHeightTableView – AamirR Mar 14 '19 at 08:52
  • This is a very simple approach to an "auto-sizing" table view: https://stackoverflow.com/a/48623673/6257435 – DonMag Mar 14 '19 at 12:53

0 Answers0