Center multiple views with varying height using au

2019-09-07 04:20发布

This answer: https://stackoverflow.com/a/25898949/1364053 is suitable for my problem to some extent. What I need is there are three views in my container view.

The middle one is a scroll view. If I pin height and width of all three views and use the ratio method as described in the above link, all works fine.

But I need the middle scrollview to grow to some extent, let's say the current height of the scroll view is 30, If the device height is increased it should grow to a max of 40 but not more than that (<= constraint).

Ok..So I tried giving two constraints to the middle view. The <= constraint has higher priorty (750) than the = constraint (250).. but when the screen size is increased.. the height stays the same. enter image description here

enter image description here

1条回答
兄弟一词,经得起流年.
2楼-- · 2019-09-07 05:19

Sample.xib The uploaded xib might help you.

Constraints screenshot

查看更多
登录 后发表回答