问题描述
我一直在敲我的头撞墙与此一段时间。我需要与标签的下彼此任意数量一个UIScrollView,然后有一个头固定到顶部并固定在屏幕的底部页脚。所有这一切都必须使用自动布局。这是可能的呢?
I have been banging my head against a wall for a while with this. I need to have a UIScrollView with an arbitrary number of labels under each other and then have a header pinned to the top and a footer pinned to the bottom of the screen. All this needs to be using auto layout. Is this possible at all?
任何帮助将是AP preciated
谢谢,
Any help would be appreciatedThanks,
亚历普顿
推荐答案
您可以添加标题和放大器;滚动和放大器内部页脚视图;添加标签之间和放大器;加约束的头顶部,前置,高度。然后加约束标签,按您的要求和放大器;最后补充约束页脚观为前置,高度和放大器;底部。底部约束是必须要知道它的滚动视图内容大小。
You can add header & footer view inside the scroll & add the labels in between & add constraints to header as top, leading, trailing, height. Then add constraint to labels as per your requirement & Finally add constraint to Footer view as leading, trailing, height & bottom. Bottom Constraint is must to know scrollView its content size.
这篇关于自动版式的UIScrollView用'尾'已固定至屏幕下方的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!