问题 I am implementing a scrollview with multiple views in it programmatically. When I add subviews to it, they are not been displayed. 回答1: Here is a full example of adding 3 UIView subviews to a UIScrollView , using constraints to define the scroll view's .contentSize . You can run this directly in a Playground page - including the ability to scroll: import UIKit import PlaygroundSupport class TestViewController : UIViewController { let redView: UIView = { let v = UIView() v.backgroundColor =