ScrollView中的视图不受尊重约束

时间:2018-02-09 14:44:54

标签: ios swift xcode uiscrollview scrollview

我在我的View Controller中添加了 ScrollView 。然后,我在内部元素和滚动视图本身之间创建了约束,但我不明白为什么我的黄色视图没有占据整个宽度。

以下是我的观点和约束的截图:

enter image description here

有时我明白了,为什么?

enter image description here

当我不使用Scroll View时,一切都很完美。

1 个答案:

答案 0 :(得分:1)

控制从mapView拖动到外部主视图并选择等宽