iPhone6 (no display zoom mode) UIMenuController truncated - ios

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

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.

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.

Related

iOS - New keyboard style on a textview/textfield

I have realised that the keyboard which appears on my application doesn't have the same layout/appearance than others on the same device.
Keyboard that appears on my app:
Keyboard that appears on Safari:
Both screenshots has been taken on the same device with iOS 10.2. The second keyboard has like a modern style with more keys but using less space on the screen.
I think it could be related to some configuration on the project. I have tried the same textview but on a new empty project and I'm getting the new keyboard layout.
This is the current textview configuration (yes, it's an old project that uses xib files)
Do you know what I need to get the new keyboard style on my app?
As #Larme has said, the application was not optimized for iPhone 6/plus. Adding the following image size to the launch image was enough:
Default-667h#2x.png: 750 x 1334 (iPhone 6, Portrait)
Default-736h#3x.png: 1242 x 2208 (iPhone 6 Plus, Portrait)

UIImageView image not showing up in IPhone 5s,6 and 6+

i am facing strange issue in one of my old app when running on iPhone 5s,6 and 6plus.i notice when i run the app on iPhone 5 and ipad its working fine,but when i run the same app in iPhone 5s or later devices all my app screens looks white and it did not showing any image in my entire app.All the other things like Label,tableview working fine on these devices.here is some screen shot of my app
As my screen shot shows every thing is ok in iPhone 5 simulator but when it comes to iPone 5S or later devices entire screen is white.Any help will be appreciated.
Find the answer..
UIImageView alpha is getting zero.
In my case, I am using category for UIImageView. I commented that and everything working alright now.
#implementation UIImageView (ForScrollView)
//- (void) setAlpha:(float)alpha {
// [super setAlpha:alpha];
//}

iOS 8 Orientation Issues : Keyboard ends up in incorrect position

I have a universal project for iOS that was created in xCode 5 that I am trying to port to xCode 6. Everything seems to have been fine since I am not using LaunchScreen and iPhone 6 and 6 Plus scale the application to their resolutions.
The problem occurs when device changes its orientation.
Scenario:
It only occurs on iPhone 6 and 6 Plus.
Open Login screen with username and password fields. Rotate the device to Landscape, and tap username or password field. The keyboard appears in the middle of the screen with half cut. Rotating back to portrait hides the keyboard altogether and it no longer appears on screen no matter which field you tap on.
To get the keyboard back, rotate back to Landscape, tap on a field rotate device to opposite Landscape (don't let it go in Portrait). The keyboard suddenly becomes normal and acts fine.
I got the same problem, and that's because your app is launched in scaled mode.
It seems that Apple didn't go the full blown way to handle landscape in this scaled mode.
The solution is to switch to non-scaled mode for the iPhone 6-6Plus, using the trick specified here: How to enable native resolution for apps on iPhone 6 and 6 Plus?
Note that this will likely break a lot of your screens in the process.. but there's no other solution.
I have faced this issue with scalable mode of the app. Though supporting non-scalble mode (by adding iPhone 6 & 6+ launch images to xcassets) solves this problem, it was not permissible in my case as screens had static layout for each orientation.
I could solve this problem by avoiding the incidents of changing the root view controller of the window. Instead, the new view controllers have been added (with balancing removal) as subview (and hence childViewController) to the existing root view controller.
Everything is ok on iOS6/7, But not iOS8.
The orientation of the keyboard on iOS 8 is not the same as status bar.
If your application runs only portrait mode you can stop generating orientation notifications;
[[UIDevice currentDevice] endGeneratingDeviceOrientationNotifications];
I have faced this issue, and after some research I found some stuff, that caused such bug.
In my AppDelegate I changed window rootViewController to show different ViewControllers depends of authorization status
if (!auth)
{
self.window.rootViewController = [[AuthViewController alloc] init];
} else {
self.window.rootViewController = [[DataViewController alloc] init];
}
I removed this and move controller select logic to NavigationViewController
if (!auth)
{
self.viewControllers = #[[[AuthViewController alloc] init]];
} else {
self.viewControllers = #[[[DataViewController alloc] init]];
}
and make this NavigationViewController as Storyboard initial view controller.
Hope it helps!

UIMediaPickerController under iOS 8

I've run into an issue with the media picker on iOS 8.
I have an iPad application, landscape mode supported only.
The following code works just fine under iOS 6 and iOS 7, but on iOS 8, it presents the media picker in landscape mode, but a vertical gradient line appears along the right side of the picker, where the portrait version would have its right edge. The picker works fine also to the right of this line, but I cannot figure out, how to make this gradient go away.
- (void) viewDidAppear:(BOOL)animated
{
MPMediaPickerController *mediaPicker = [[MPMediaPickerController alloc] initWithMediaTypes:MPMediaTypeMusic];
[self presentViewController:mediaPicker animated:YES completion:^{
}];
}
I'd appreciate your expert help ;
In my case the solution was changing the Orientation in the Deployment info. I had to uncheck the "Landscape" box. Of course now the orientation is not fixed but at least the "black gradient" problem was solved.

Button Images Don't Show When Using Xcode 5

I have several buttons with images assigned to each. In Xcode 4.6 using the iOS 6 SDK, they show like they should. When using Xcode 5 with the iOS 7 SDK, the images are not there. In the xib it says an image is on the button but it doesn't appear. Any ideas why?
iOS 6:
iOS 7:
For me, my problem was that the button type was set to System instead of Custom. They displayed fine in iOS 6.0 and iOS 6.1 Simulators, just not iOS 7.0 simulator. I'm not sure how this happened as I'm pretty sure it's the first time the project had been opened in Xcode 5 with iOS 7.0 sdk. I had three buttons, 1 showed fine because it was a Custom button, and the other two did not show their images, but could be pressed. Once set to Custom button types, all worked great, as expected.
I was able to get the images to appear after setting the tint color to clear and setting the image and background image to what I wanted. In Xcode 4 I didn't have to change any of that and I didn't have to set the background image, just the image.
yes it is iOS7 issue.
Set bottom margin of the image/label through autolayout then try this code in your viewDidLoad and this should work.
if ([self respondsToSelector:#selector(setNeedsStatusBarAppearanceUpdate)])
{
[self prefersStatusBarHidden];
[self performSelector:#selector(setNeedsStatusBarAppearanceUpdate)];
}
else
{
// iOS 6
}

Resources