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

CustomGap doesn't affect the final size of presented view #101

Open
popei69 opened this issue Apr 25, 2019 · 4 comments
Open

CustomGap doesn't affect the final size of presented view #101

popei69 opened this issue Apr 25, 2019 · 4 comments

Comments

@popei69
Copy link

popei69 commented Apr 25, 2019

I'm trying to place UI component depending of the size of the presented view, for instance having a button at the bottom of the drawer.

When testing it, it seems that the size of the presented view is never matching the size left from the custom gap. For instance, if I set a .leavesCustomGap(gap: 100), the view presented frame won't get shorter of 100. Therefore any elements at the bottom might not be visible.

I guess what I would expect is that if the drawer can have a maximum size of 500, its presented view and contained one would reflect the same size. That's not the case at the moment. Is it something available with DrawerKit?

To replicate it, inspect the view frame in a presented view controller (in viewDidAppear for instance), it will be the size of the screen regardless the maximum size available of the drawer.

@ilyapuchka
Copy link
Contributor

Indeed the position of the drawer in the fully expanded state is fixed and it does not consider the content. I have a similar issue, where I have to use partially expanded state to accommodate the content but there is no way then to disable fully ex expanded state

@ilyapuchka
Copy link
Contributor

@popei69 is your issue that the drawer is not respecting the content size of the presented view or the other way around, that the content view is not respecting the size of the drawer?
To avoid having not visible elements you can try to put them in a scroll view. DrawerKit has support for that (see demo app) so that it works fine in terms of scrolling behaviour.

@popei69
Copy link
Author

popei69 commented May 2, 2019

@ilyapuchka thanks for the feedback. The idea is actually to have a sticky button at all time at the bottom of the drawer regardless how far it is open, or at least when half opened and fully opened. But the rest of the page would still be scrollable. To give you an idea, I'm looking for a similar behaviour as the Instagram Share Post feature.
I just can't see a way to do that with AutoLayout and DrawerKit at the moment with a content size always describing the whole screen.

@ilyapuchka
Copy link
Contributor

yep, I think out of the box it's not supported. You could try to hack in with animation behaviour, but I doubt it will really help.
I doubt it will work nicely with autolayout but you could make update the frame of the button manually somehow.
Speaking of autolayout it would be handy if drawer kit would provide some kind of layout guides that one could use to attache views to, or if it would adjust safe are of views involved in the presentation. For instance I had an issue when the button should be displayed in the repenting (background) view right above the drawer, it would maybe make it simpler if safe area of presenting view would be adjusted by the drawer, so that when it appears the button slides to the top with it. It might be tricky to make it universal though, but just adding layout guides in the drawer would help in your issue.

cc @inamiy @Ben-Henshall

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

2 participants