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

Overflow menu misplaced in landscape mode in iOS 9 #3

Closed
AmrKafina opened this issue Oct 14, 2016 · 5 comments
Closed

Overflow menu misplaced in landscape mode in iOS 9 #3

AmrKafina opened this issue Oct 14, 2016 · 5 comments

Comments

@AmrKafina
Copy link

AmrKafina commented Oct 14, 2016

When a device rotated to landscape mode, the menu isn't displayed properly. I believe the issue has something to do with the autoresizing masks:

- (UIViewAutoresizing)autoresizingMasks {
return UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
}

simulator screen shot oct 14 2016 9 13 20 am

The issue seems to only appear on iPhone devices, not iPads. Apparently when the status bar is hidden (as is the case on iPhone devices in landscape), opening the menu makes the status bar appear again and causes the issue.

@sdpjswl
Copy link
Owner

sdpjswl commented Oct 14, 2016

You seem to be right, it seems related to the status bar hiding and showing. The menu is actually shown on a new UIWindow, I think that's where the status bar comes from. I'll look more into this issue.

@AmrKafina
Copy link
Author

AmrKafina commented Oct 14, 2016

Yup, found this on stackoverflow, which fixed most of the issue, but you still have to add a check to keep the status bar from disappearing all the time (ie in portrait). Also have to edit the menu's height / frame to accommodate for the missing status bar.

@AmrKafina
Copy link
Author

Turns our all you have to do is set a rootviewcontroller for the window (_overflowWindow.rootViewController = [UIViewController new];), and change autoresizingMasks to return UIViewAutoresizingNone (not sure if this screws up something else).

There's still the issue of the menu's height when in a vertically compact environment / when no status bar is shown.

@sdpjswl
Copy link
Owner

sdpjswl commented Oct 19, 2016

Setting a dummy root view controller does the job; no longer the status bar shows-hides on rotation. I have set the root view controller and committed the change. Please take a look. I will keep trying on my end.

My observations:

  1. Setting UIViewAutoresizingNone on the menu's UIWindow doesn't seem to make a difference.
  2. The issue happens when menu is already open and rotation occurs. Then the menu size/position gets all screwed up. Do you have any suggestions? I tried to hide existing menu and show new one after rotation but it didn't work.
  3. However, If menu is not showing and after rotation, I tap the show button, the menu shows normally like it does in portrait.
  4. In whatever orientation the menu is shown, the height is not correct, it is slightly less than expected in landscape and slightly more in portrait. In portrait, the menu should end with Item 6's separator.

This is strange. The menu uses a UITableView to show the options. My calculation for the menu's height and the table view's content height are exactly the same.

@sdpjswl
Copy link
Owner

sdpjswl commented Jan 25, 2022

Issue related to transform applied to menu view. Fixed.

@sdpjswl sdpjswl closed this as completed Jan 25, 2022
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