Closed ghost closed 3 years ago
Thanks! The size of the .open
state is defined by topMargin
property. So, there's no way of setting the open size to a specific height. You can only tell how much smaller the drawer is to its superview.
However, I'm facing the same issue where some content doesn't span full screen and would look better without the extra space at the bottom. I was thinking of adding a way to control the maximum height of the drawer. Would that help your use case?
@mkko actually that would help in a case where I am using the Drawer.
I have a Use Case where only the content of the Drawer should be visible and the only action should be to close the drawer (no pulling up or down). My current implementation of your drawer adds the contentView from a xib and I set the drawer.partiallyOpenHeight = contentView.intrinsicContentSize.height
and set drawer.snapPositions = [.partiallyOpen]
. Unfortunately the height of the Drawer still is higher than the content (e.g. 688 on a plus device) which leads to broken constraints of my contentView and the last element in that view is stretched until the end of the drawer. I tried to set drawer.frame.size.height = contentView.intrinsicContentSize.height
but that did not help.
@vincentthe0ne Apologies for the big delay, but if your issue is still valid, could you check https://github.com/mkko/DrawerView/pull/21? Besides the modal drawer presentation, there's an option to specify the height of the drawer. I'll merge it once I'm confident that it serves different use cases well.
Oh, and this is also to address your issue, @ghubaddole.
I'm planning on adding a more or less dynamic behavior into the drawer so that optionally it's not at full height. The API is still unclear to me but I'l be working on this as soon as I have time. I'll let you know when I have a PR for this ready.
This is awesome. I don't have a full screen view. Can we specify a hight for .open state as well, if so how?