Note that there are some explanatory texts on larger screens.

plurals
  1. POSplit Keyboard movement detection
    text
    copied!<p>I have been playing around with the frame for Split Keyboard on iPad. </p> <p>Well, it seems <code>UIKeyboardWillChangeFrame</code> is triggered whenever split keyboard is show or hidden. </p> <p>In the docked mode, <code>UIKeyboardWillShow</code> and <code>UIKeyboardWillHide</code> notifications are triggered.</p> <p>In the NSNotification object, we are able to retrieve the frame of the keyboard which is true for both docked and split mode. </p> <p>Now the real fun begins when <strong>we move the split keyboard on screen</strong>. Everytime we move the keyboard on screen, endframe of in the notification object comes as(0,0,0,0). After i convert the frame using <code>convertFrame</code> co-ordinates changes to <code>(0,-124,0,0)</code>. This is true for keyboard movement in either UP or Down direction. </p> <p>In all other cases, endframe seems to be providing with the correct co-ordinates on the frame.</p> <p>This code gives me the exact frame in points.</p> <p><code>CGRect startFrame = [[[notif userInfo] objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue];</code></p> <p><code>CGRect endFrame = [[[notif userInfo] objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue];</code></p> <p>This endframe is (0,0,0,0) when the user moves the split-keyboard on screen. </p> <p>Now to get the exact coordinates according to the current view:</p> <pre><code>CGRect convertedStartFrame = [self.view.window convertRect:startFrame toView:self.view]; CGRect convertedEndFrame = [self.view.window convertRect:endFrame toView:self.view]; This convertedEndFrame = (0,-124,0,0) when endFrame = (0,0,0,0). </code></pre> <p>One more thing, I am not moving keyboard via code.</p> <p>I am not really sure, if this is a known bug from Apple or I am missing out something.</p> <p>Hopefully some one can point out things to me.</p> <p>Thanks.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload