PinLayout
PinLayout copied to clipboard
Can I let View A cover B half?
like this .
I tried
view.addSubview(A)
view.addSubview(B)
A.pin.top().left().right()
btnContainer.pin.top(B.edge.top).left(to: B.edge.left).right(to: B.edge.right)
but it not work. just list A,B vetically.
Your code snippet is a little bit confusing but yes you can. I would recommend taking a look at pinning view edges in the readme. You just need to pin B top edge to A vCenter edge.
https://github.com/layoutBox/PinLayout#pinlayout-uiviews-edges