ios - how to make UIView with equal width and height with SnapKit in Swift? -


i want make uiview rectangular snapkit in swift, this

lazy var customview: uiview = {         let view = uiview(frame: cgrect())         self.addsubview(view)         view.snp.makeconstraints({ (make) in             make.left.top.bottom.equaltosuperview().inset(self.inset)             make.width.equalto(make.height)  // error in line         })         return view     }() 

you have use view.mas_height instead of make.height:

lazy var customview: uiview = {     let view = uiview(frame: cgrect())     self.addsubview(view)     view.snp.makeconstraints({ (make) in         make.left.top.bottom.equaltosuperview().inset(self.inset)         make.width.equalto(view.mas_height) // <---     })     return view }() 

Comments

Popular posts from this blog

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -