I'd like to limit the width for menus with a direction of left/right, so that (especially on iPads) the menu doesn't end up taking the whole screen.
I figured that I'd have to set limitMenuViewSize to YES and set minimumMenuViewSize to the maximum size.
First, it's a bit confusing to call the property "minimumMenuViewSize" when it describes the "maximum" dimensions of the menu.
Secondly, and more importantly, it's awkward to handle rotation situations properly with the limits enabled. Let's say you set it to something like CGSizeMake(300, 1024), the menu will be filling the screen vertically and be 300 points wide. If you rotate the device now, the menu will remain at 1024 and screw up the user experience. The only way to work around this is to manually "fix" the width/height after a rotation - and that wouldn't feel very good.
What I'd like to see is to be able to assign a zero value to either the width or height, so that it limits the size of the menu in one dimension while keeping it properly sized in the other direction.
So for instance, a menu that has a maximum width of 300, but fills the height of the screen, could be defined as follows:
menu.maximumMenuSize = CGSizeMake(300, 0);
Respectively, having the default behaviour would be like this:
menu.maximumMenuSize = CGSizeMake(0, 0); // or CGSizeZero
By respecting the zero value in both directions, it would also allow you to get rid of the limitMenuViewSize flag at all, which would simplify the API.
I'd like to limit the width for menus with a direction of left/right, so that (especially on iPads) the menu doesn't end up taking the whole screen.
I figured that I'd have to set
limitMenuViewSize
toYES
and setminimumMenuViewSize
to the maximum size.First, it's a bit confusing to call the property "minimumMenuViewSize" when it describes the "maximum" dimensions of the menu.
Secondly, and more importantly, it's awkward to handle rotation situations properly with the limits enabled. Let's say you set it to something like
CGSizeMake(300, 1024)
, the menu will be filling the screen vertically and be 300 points wide. If you rotate the device now, the menu will remain at 1024 and screw up the user experience. The only way to work around this is to manually "fix" the width/height after a rotation - and that wouldn't feel very good.What I'd like to see is to be able to assign a zero value to either the width or height, so that it limits the size of the menu in one dimension while keeping it properly sized in the other direction.
So for instance, a menu that has a maximum width of 300, but fills the height of the screen, could be defined as follows:
Respectively, having the default behaviour would be like this:
By respecting the zero value in both directions, it would also allow you to get rid of the
limitMenuViewSize
flag at all, which would simplify the API.