系统报错,约束怎么怎么滴。
这样是对的
if count > 0 {
let containerView = UIView()
scrollView.addSubview(containerView)
containerView.snp_makeConstraints(closure: { [weak self] (make) in
make.edges.equalTo((self?.scrollView)!)
make.height.equalTo((self?.scrollView)!)
})
这样是错的
if count > 0 {
let containerView = UIView()
containerView.snp_makeConstraints(closure: { [weak self] (make) in
make.edges.equalTo((self?.scrollView)!)
make.height.equalTo((self?.scrollView)!)
})
scrollView.addSubview(containerView)