[英]Do you know why stack view in scroll view doesn't fit on simulator?
hello every one basically I want to fit stack view in scroll view in my Xcode design it's ok, and I have not an error but unfortunately in simulator really different about design, and here is my stack view and scroll view constraints and also I bring the result in simulator:大家好,基本上我想在我的 Xcode 设计中将堆栈视图放入滚动视图中,这没关系,我没有错误,但不幸的是在模拟器中的设计确实不同,这是我的堆栈视图和滚动视图约束,我也带来了结果模拟器:
and also this is my one of content constraints that all of view like this are horizontally and vertically in container alignment:这也是我的内容限制之一,所有像这样的视图在容器 alignment 中都是水平和垂直的:
could you tel me what's your opinion to solve this matter?你能告诉我你对解决这个问题有什么看法吗?
The reason why the each content is piling up like the result in simulator is because scroll view unable to calculate content height and also each content constraint has the center point set up to be the same as another (or the same as stack center)每个内容像模拟器中的结果一样堆积的原因是因为滚动视图无法计算内容高度,并且每个内容约束的中心点设置为与另一个相同(或与堆栈中心相同)
What you can do to fix the UI is你可以做些什么来修复 UI
So in summary, each view should have this constraint:所以总而言之,每个视图都应该有这个约束:
That way scroll view can calculate its content height这样滚动视图可以计算其内容高度
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.