【问题标题】:Autolayout UIScrollView Constraints自动布局 UIScrollView 约束
【发布时间】:2022-06-17 15:02:50
【问题描述】:

我知道这已经被问过上千次了。我已遵循所有准则,但仍然无法正确完成。

这是我的约束(以编程方式添加)

  1. ScrollView: 顶部/底部/左侧/右侧锚点设置为以 0 常量查看锚点。
  2. ScrollView 中添加了ContainerView
  3. ContainerView (UIView):top/bottom/left/right/width/height 锚点设置为 scrollView 锚点,常量为 0
  4. ContainerView 中添加了ContentView (UIView)
  5. ContentView:对ContainerView 的上/左/右约束,带有一些常量。
  6. ContentView 中添加了dummyView (UIView)
  7. dummyView:对ContentView 的上/左/右/下约束,带有一些常数。固定值设置为 1200(随机数)的高度锚。

正确查看布局,没有警告或错误,但不会滚动到底部。

我在这里缺少什么?

【问题讨论】:

  • 数字 3 是错误的。

标签: swift uiscrollview autolayout


猜你喜欢
  • 2012-11-10
  • 2014-12-29
  • 2013-03-16
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多