简体   繁体   中英

How to layout with two container views with embedded tables

I am trying to layout the following UI View

The Main UI View has two Container Views. The top container view embeds a static table controller. The bottom container view embeds another table controller which I want to be dynamic.

How can I set the layout so that the height of the top container view is equal to that of the top table, and the bottom container view gets the rest?

Right now height is ambiguous for the container views.

Constraint your top table view's height to some fixed value (it doesn't matter what).

Make an outlet of that height constraint.

In your view controller, do this:

heightConstraint.constant = tableView.contentSize.height

this way bottom view will adjust accordingly.

Make sure to disable bouncing in the top table view.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM