black
2014-11-29 13:50:58 +08:00
文档里有说:
The UIScrollView class scrolls its content by changing the origin of its bounds. To make this work with Auto Layout, the top, left, bottom, and right edges within a scroll view now mean the edges of its content view.
也就是说在UIScrollView里,subview不能依赖自身相对于scroll view的约束来得到自身的size,也就导致scroll view不能基于subview来确定自身的size。
所以,应该是只能将scroll view添加到一个view上去,然后定义scroll view的subview相对于那个view的layout constraint才能正常工作的。