When YES, content and subviews are clipped to the bounds of the view. Default is NO.
屏幕快照 2016-03-18 上午8.24.27.png
圖中橙色為UIScrollview,藍色為scrollview中添加子視圖。
因為默認UIScrollview的clipsToBounds為NO,也就是不裁剪。所以會顯示子視圖的全部。
要想只顯示scrollview中可見的部分。需要設置clipsToBounds為YES。這樣就可以把多余的給裁剪掉。只顯示UIScrollview中可見的部分。