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?
Asked
Active
Viewed 75 times
1
-
Check the answer [http://stackoverflow.com/a/14228015/3177007](http://stackoverflow.com/a/14228015/3177007). – Mohamed Jaleel Nazir Feb 20 '16 at 06:41
1 Answers
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
-
ok thank you but where do i set the calculated height to my UITableView? – hannes Feb 19 '16 at 12:50