iPhone6 (no display zoom mode) UIMenuController truncated

只愿长相守 提交于 2019-12-31 00:34:09

问题


I have a problem with the UIMenuController on my iPhone 6 when I use the standard display mode and device is in landscape mode. On iPhone 6 Plus the problem is in both modes. Maybe it's depends on screen resolution.

In that case, the UIMenuController will be truncated left and/or right. It seems that the UIMenuController can have maximum bounds as if the phone is in portrait mode.

See UIMenuController truncated (iPhone6 landscape schematic): http://imageshack.com/a/img631/8470/ozlaGe.jpg "iPhone6 landscape"

For me it seems like an iOS8+iPhone 6 bug. The code didn't change for a long time and worked. In zoomed display mode, UIMenuController will be displayed correctly like on all other iPhones/iPads incl. iOS7.

... define UIMenuItems....
[self becomeFirstResponder]; // canBecomeFirstResponder returns YES;
UIMenuController *menu = [UIMenuController sharedMenuController];
[menu setMenuItems:items];

.. define frame...
[menu setTargetRect:frame inView:self];
[menu setMenuVisible:YES animated:YES];

Fixed: see comment from Iliya Barenboim


回答1:


The reason is that you didn't have launch images for iPhone 6 and iPhone 6+.

One other thing that I ran into when adding the launch images, is that there is a bug when doing this with an asset catalog. I added static launch images to my project and manually edited my info.plist as described here: https://stackoverflow.com/a/25960203/378179.




回答2:


It's not a compilation issue. I ran the same code on the iPhone 5 iOS 7.1 simulator in Xcode 6.1, and the problem doesn't appear -- only when you run with the iPhone 6 / iOS 8 simulators (and, of course, on the iPhone 6 device itself). So it's a problem with the iOS 8[.1] runtime.



来源:https://stackoverflow.com/questions/26506437/iphone6-no-display-zoom-mode-uimenucontroller-truncated

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!