PinLayout icon indicating copy to clipboard operation
PinLayout copied to clipboard

Can I let View A cover B half?

Open tanpengsccd opened this issue 2 years ago • 2 comments

image like this .

tanpengsccd avatar Jun 26 '22 17:06 tanpengsccd

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

tanpengsccd avatar Jun 26 '22 17:06 tanpengsccd

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

antoinelamy avatar Jul 01 '22 20:07 antoinelamy