Keyboard shows partially ios6

I’m stuck in solving the question of why the keyboard in my application appears partially on the screen or does not appear at all. This is just a simple view controller presented with

[self presentViewController:vc_browser animated:YES completion:^{}]; 

The first time I introduce him, everything works fine. Then I reject it with

 [self dismissModalViewControllerAnimated:NO]; 

and when re-submitting (and beyond) this $ #%! happens. Creating a keyboard frame from the notification gives

2012-12-30 00: 40: 21.618 test [12080: 907] frame frame raw {{160, 443}, {0, 44}}

2012-12-30 00: 40: 21.619 test [12080: 907] converts to the keyboard frame {{{320, 886}, {0, 88}}

2012-12-30 00: 40: 21.836 test [12080: 907] keyboard frame raw {{0, 524}, {320, 44}}

2012-12-30 00: 40: 21.837 test [12080: 907] the keyboard frame is transformed {{0, 1048}, {640, 88}}

in the figure below, the focus is inside the webView (actually Google search fields)

if I move focus to the text box above the keyboard on the right, {{inf, inf}, {0, 0}}

viewWillAppear and viewDidAppear not implemented

the submitted view controller is loaded this way

 _vc = [[VC alloc] initWithNibName:@"VC" bundle:nil]; 

I tried loading this view controller from another xib or another storyboard, but the problem is there.

Any help resolving this would be great. Thanks.

http://i.stack.imgur.com/xBNZt.png

unable to send image with rep <10

+4
source share
1 answer

I have the same problem too. I do not know how to post a comment on your question (I'm still new to stack overflow), so I provide what I discovered before the partial answer. Still exploring the complete solution.

Using Xcode 4.5.1 and my application uses iOS 6. Its universal application using Core Data and iPhone works fine. The iPad side is a Split View. From the detailed view manager, the user can open a full window above the split view to display the photo. Refusing to view the photo returns you to split mode.

The code below is about how the photo browser is called and removed.

 [self presentViewController:photoBrowser animated:YES completion:nil]; [self dismissViewControllerAnimated:YES completion:nil]; 

After the snapshot opens, when I have a problem with the keyboard.

Symptoms: Subsequent views with UITextFields or UITextViews will no longer automatically display the keyboard, or the keyboard is only partially displayed, as in the example of your photo. I use startFirstResponder to call the keyboard.

 [self.noteEdit becomeFirstResponder]; 

Which is also strange, if I touch any UITextField, then all text fields in this view disappear.

I opened Apple Technical Support (TSI) for this problem. Here is their answer on October 12, 2012.

I want to inform you of your incident. Thank you for submitting to your code and sample database. I was able to reproduce the problem. It turns out that text fields disappearing in the detail view controller are the result of the keyboard returning invalid data for UIKeyboardFrameEndUserInfoKey, forcing your code to set the scroll frames to an invalid size. I keep looking for the root cause of this unexpected keyboard behavior and write back as soon as I have an answer.

I checked his answer by specifying the values ​​of the user information UIKeyboardFrameEndUserInfoKey.

 NSLog(@"keyboardEndFrame orig.x=%f orig.y=%f size.w=%f, size.h=%f", keyboardEndFrame.origin.x, keyboardEndFrame.origin.y, keyboardEndFrame.size.width, keyboardEndFrame.size.height); 

And, of course, the values ​​for both x and y were "inf". Size values ​​were set to zero.

Now I just need to know the reason for all this. Still researching, but I'll keep you posted on any Apple answer. This is so far I have not worked.

PS ... My application (iPhone and iPad) worked fine in iOS 5.

Update - October 17, 2012:

The reason for the keyboard problems was due to my mistakes in introducing the new iOS 6 Orientation handling method. I turned on my split view controller to enable the following:

 - (NSUInteger)supportedInterfaceOrientations { return [[self splitViewController] supportedInterfaceOrientations];} 

Corrected Code:

 - (NSUInteger)supportedInterfaceOrientations{ return UIInterfaceOrientationMaskPortrait;} 

This was pointed out to me when my Apple Technical Support Incident responded as follows:

I tracked the root cause of your keyboard problems. In SplitController.m, the method supported by InterfaceOrientations calls: [[self splitViewController] is supported by InterfaceOrientations]; and returns the resulting value. However, the splitViewController property of a split view controller is zero because split view controllers do not allow the use of other split view controllers. Thus, the return value is 0, which is an invalid orientation mask.

My application supports different types of orientation based on what kind of view is on top of the stack, but I have incorrectly encoded the Split View controller.

Apple's technical support team helped me a lot. Hope this information helps you.

Hooray!

+4
source

Source: https://habr.com/ru/post/1439785/


All Articles