-
Notifications
You must be signed in to change notification settings - Fork 11
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
[Question] Dynamic constraints/Removing constraints #3
Comments
Currently we just make a new auto layout view with the new constraints like so: |
For now that's the only official way, as the
The underlying
To optimize this so that we don't have to recreate the whole View to change constraints, we need to hook up a new removeConstraints method to kiwi.Solver's. |
Hey, thanks for the quick reply.
I noticed that about the kiwi solver. Is adding I guess another wrinkle might be making sure that the VFL/EVFL parsers return the constraints they create so that they can be removed. It would also be nice to be able to remove a SubView and have it automatically remove all associated constraints. |
Looks like this is already the case. I notice that there are also some constraints created implicitly in SubView. Those may or may not be the kinds of constraints that a user might want to remove. I don't know. |
Yeah, that would be robust. Add or remove things and it updates as we'd expect. I don't have the time at the moment to get to this, but would be happy to merge a PR! |
Looking more at this, I think it might make some sense to make some changes to Kiwi first. Are you open to PRs? There's no public API in Kiwi to return the constraints, for example. |
Yeah, totally open to PRs. Would be great to add that. |
Looking at the API, there don't seem to be any options for removing constraints or subviews. I didn't see anything in the docs or examples about how to handle the case of subviews getting removed or their relationships to other subviews changing. Is there any way to do that with this library?
The text was updated successfully, but these errors were encountered: