layoutBox/PinLayout

Can I let View A cover B half?

tanpengsccd opened this issue · 2 comments

image

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.
image

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