中心,使用自动布局变化的高度的多个视图 [英] Center multiple views with varying height using autolayout

查看:89
本文介绍了中心,使用自动布局变化的高度的多个视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这答案: http://stackoverflow.com/a/25898949/1364053 是适合我的问题有些程度。我需要的是有我的容器视图三视图。

This answer: http://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.

但我需要中间的滚动型成长到一定程度,假设滚动视图的当前高度是30,如果设备高度增加它应该长到40最大,但不多说(小于=约束)。

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我试图给两个约束到中间视图。的&lt; =约束具有比=约束(250)更高先决(750)..但是当屏幕尺寸增大..高度保持不变。

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.

推荐答案

Sample.xib
上传的厦门国际银行可能会帮助你。

Sample.xib The uploaded xib might help you.

这篇关于中心,使用自动布局变化的高度的多个视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆