1

i have a tableview with a dynamic changing number of cells. sometimes there are 10, another time more than 20 cells. This Tableview is on a Viewcontroller, but i have so much content on this tableview, so my tableview and all other content are on a scrollview. now i have a double scroll. on on my scrollview, and another on my tableview and this is quite uncomfortable. so how can i set the height of my tableview dynamically?

hannes
  • 519
  • 4
  • 11
  • 23

1 Answers1

1

If you are using Autolayout with storyboard then set constraints of your tableview

let Count = CGFloat(dataArray.count)
constraintsTblHeight.constant =  Count*100 //100 is your tablview's cell height

other wise increase this height in tablview height

Jogendra.Com
  • 6,394
  • 2
  • 28
  • 35