我在子类中有以下viewDidLoad
方法实现UIViewController
:
var scrollView = UIScrollView.newAutoLayoutView()
var contentView = UIView.newAutoLayoutView()
override func viewDidLoad() {
super.viewDidLoad()
view.addSubview(scrollView)
scrollView.autoPinEdgesToSuperviewEdgesWithInsets(UIEdgeInsetsZero)
scrollView.addSubview(contentView)
contentView.autoPinEdgesToSuperviewEdgesWithInsets(UIEdgeInsetsZero)
contentView.autoMatchDimension(.Height, toDimension: .Height, ofView: view)
contentView.autoMatchDimension(.Width, toDimension: .Width, ofView: view)
contentView.addSubview(customView)
customView.autoPinEdgeToSuperviewEdge(.Top, withInset:0)
customView.autoPinEdgeToSuperviewEdge(.Left, withInset:15)
}
但是当我运行应用程序时,内容不会滚动。我发现很少有PureLayout文档和示例,并且对滚动视图一无所知。有人可以帮我解决这个问题吗?