Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can I let View A cover B half? #252

Closed
tanpengsccd opened this issue Jun 26, 2022 · 2 comments
Closed

Can I let View A cover B half? #252

tanpengsccd opened this issue Jun 26, 2022 · 2 comments

Comments

@tanpengsccd
Copy link

tanpengsccd commented Jun 26, 2022

image

like this .
@tanpengsccd
Copy link
Author

tanpengsccd commented Jun 26, 2022

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

@antoinelamy
Copy link
Contributor

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

@lucdion lucdion closed this as completed Aug 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants