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

Bottom elements don't move when closing #42

Open
heltisace opened this issue Dec 13, 2018 · 6 comments
Open

Bottom elements don't move when closing #42

heltisace opened this issue Dec 13, 2018 · 6 comments

Comments

@heltisace
Copy link

If you add some component in the bottom with constraints not being set to top (for example bottom, sides and constant size) you will get this.

@heltisace
Copy link
Author

heltisace commented Dec 13, 2018

Temporarily fixed by removing bottom constraints.
UPD: I mean bottom constraints in your lib.
UPD2: Doesn't fully solve the problem, because now transition animation can't get where elements must be.

@MarioIannotta
Copy link
Owner

I saw the video and I don't really understand what's going on.
I guess your main view has a blue background and your popup view controller's view is white and then you've added another view (the yellow one) on top of everything, is that right?
What's the problem?

@heltisace
Copy link
Author

heltisace commented Dec 14, 2018

Not quite. The yellow view is inside PullUpController and, obviously, it shouldn't behave as it does. Here is this project. Please, take a look.
Drawers.zip

@MarioIannotta
Copy link
Owner

MarioIannotta commented Dec 14, 2018

Ok, I've found a solution.
The problem was the pull up controller's view bottom anchor is equal to the parent view bottom anchor and to match this constraint, when the view is dragged down (aka the top constraint's constant is increased), it shrinks.

Instead of bottomConstraint = parentView.bottomAnchor.constraint(equalTo: view.bottomAnchor) we could use bottomConstraint = parentView.bottomAnchor.constraint(lessThanOrEqualTo: view.bottomAnchor)

I need to check if this change causes some regression, if not, I'll commit the change.

@heltisace
Copy link
Author

heltisace commented Dec 17, 2018

@MarioIannotta I found a bug with this solution. Now animation causes PullUp to jump from the bottom and show some free space there. We've already experienced this problem before, if you remember.

UPD: This is second video on here: #33 (comment)

@Gargo
Copy link

Gargo commented Mar 6, 2023

@MarioIannotta the question is why do you use 3 constraints to specify a vertical position on the screen while 2 of them is enough - bottom and height for example?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants