简体   繁体   中英

IOS Constraints for height (dynamic height change)

I am having trouble allowing my XIB file to contain constraint values for a view that will increase the view without covering the view beneath it. I am not sure what I am doing wrong.

essentially

(view1 here) -- lets say
(view2 here) -- lets say

both are in a larger view but when view 1 increases like so

(view1 here)
(view1 increased content here) -- view2 would now be covered instead of

(view1 here)
(view1 increased content here)
(view2 here) -- like it should be.

Sorry for not using pictures, but the question seemed really simple. I tried adding constraints but that hasn't worked is there something that is easier to do programmatically, or? I have been spending so much time on this, and I know I could do a couple things, but I don't understand why my constraints don't work when I have vertical spacing and top of view etc. nothing seems to work.

在此处输入图片说明

EDIT UPDATE: As you can see from the picture I need those all to size accordingly. When I change the tableview height of one of them, along with label correspondence to where they are. The imageview will always be there, they are all contained in a view that is in a scrollview as shown.

您必须在View2的顶部和View的底部1等于0之间添加一个约束。

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