Xcode 5 Auto Layout - Built-in Tables

I have UIScrollViewwith a few built in it UITableView. I want each table to increase its height as much as necessary to display all of its cells. The full screen is displayed in the scroll view frame, so contentSize.heightyou need to expand it to fit the largest table (which, in my opinion, is the default behavior, but I mention it just in case I am mistaken). Can all this be done on my storyboard? Or, if I need to add code for this, I found this tutorial , but for iOS 6 - is there any code for this limitation What has changed for iOS 7?

0
source share
2 answers

If you know in advance how much space each table occupies, you can do this exclusively in your storyboard, but since each UITableView is also a scroll, the default behavior of a UITableView is to fill the specified size with content and scroll if overflowing.

If you do not know the height of the tables at design time, you will need to set them at run time. See Autolayout UIScrollView for content that matches subviews and grouped tables . The short answer is to add a height constraint to the table, drag it to the controller as and then set the height when you know it.

+2
source

All Articles