Reputation: 537
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?
Upvotes: 1
Views: 84
Reputation: 6454
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
Upvotes: 1