在父视图的1/3处怎么实现呀。不是宽度1/3处。是离左边1/3处
make.width.equalToSuperview().dividedBy(3)
make.height.equalTo(49)
make.leading.equalToSuperview().dividedBy(6)。不起作用
For anyone who comes across this, my Chinese is hit or miss but I believe the question is how to get the leading edge of a view to be inset from the superview's leading edge by a multiple of the superview's width. i.e. something like make.leading.equalTo(superview.snp.width).dividedBy(6), except that attempting to do that results in NSInvalidArgumentException ... Invalid pairing of layout attributes. because it won't let you constrain a leading edge to a width
因为这是明显的语义错误,leading 和 left 一样,它是一个比较属性值,参考的是equalTo(view)的X值
Most helpful comment
For anyone who comes across this, my Chinese is hit or miss but I believe the question is how to get the leading edge of a view to be inset from the superview's leading edge by a multiple of the superview's width. i.e. something like
make.leading.equalTo(superview.snp.width).dividedBy(6), except that attempting to do that results inNSInvalidArgumentException ... Invalid pairing of layout attributes.because it won't let you constrain a leading edge to a width