【发布时间】:2016-03-20 18:27:34
【问题描述】:
我在UIViewController 子类中有以下viewDidLoad 方法实现:
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 文档和示例,并且对滚动视图一无所知。有人可以帮我解决这个问题吗?
【问题讨论】:
标签: ios swift uiscrollview autolayout pure-layout