scrollView不滚动我所有的内容 [英] scrollView not scrolling all my contents
问题描述
我使用的是scrollView,其内部使用的是视图.
I'm using a scrollView and inside it used a view.
我这样设置尺寸:
我认为我的观点始终是959.
但是当我将高度从959更改为2000时,会看到一条橙色线,并且当我使用Editor->resolve Auto..->update frames
时,我的自定义高度将返回959.
I think the height of my view always is 959.
but when I change the height from 959 to 2000, I see a orange line and when I use Editor->resolve Auto..->update frames
my custom hight returns to 959.
即使我设置了从别针开始的高度,我也会看到红线:
even when I set height from pin I see red lines:
我希望所有内容都滚动.内容的高度为2000.
I want all my content scrolling. The content's height is 2000.
推荐答案
您可以通过以下方式进行检查:
You check this following way:
滚动视图约束:
将顶部设置为您的超级视图
将底部设置为您的超级视图
将领先设置为您的超级视图
将跟踪设置为您的超级视图
将一个 UIView 放入滚动视图并应用以下约束(等于相同的 Scrollview 宽度和高度)
Take One UIView into scrollview and apply following constraints(Equal to same Scrollview width and Height)
设置顶部以滚动查看
将底部设置为滚动视图
设置领先以滚动查看
将跟踪设置为滚动浏览
别忘了设置等宽来滚动视图
然后根据需要添加所有UIElement. 如下考虑:
Then do add your all UIElements whatever you want. Consider like below:
标签1 ---->将必需约束设置为UIView
lable 1----> set necessory constraint to UIView
标签2 ---->将必要约束设置为UIView
lable 2----> set necessory constraint to UIView
标签3 ---->将必要约束设置为UIView
lable 3----> set necessory constraint to UIView
标签4 ---->将必要约束设置为UIView
lable 4----> set necessory constraint to UIView
标签5 ---->将必需约束设置为UIView,然后将底部约束赋予UIView
lable 5----> set necessory constraint to UIView and you give Bottom constraint to UIView
然后滚动将自动工作.不要那样调整值.如果要更大的屏幕,请将视图控制器的模拟尺寸更改为自由格式,然后在此处调整您喜欢的高度并基于此放置scrollview.
Then scroll will automatically work..Dont adjust value like that.If you want more large screen Change View controller Simulated size to Freeform and there you adjust your prefer height and place scrollview based on that.
这篇关于scrollView不滚动我所有的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!