iOS: scroll screen after hiding keyboard programatically

When the keyboard is told to hide, we resign first responder. If this
is done programatically on touch press, this will make the "hide keyboard
gesture" receive a touchesCancelled instead of a touchesEnded. Since we
didn't catch this from before, the gesture was left in a mixed state causing
the screen not to scroll when later showing the keyboard.

Change-Id: I70ed59710128a912097cd5bfbdd8f49b20b7934c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
This commit is contained in:
Richard Moe Gustavsen 2014-04-22 12:57:37 +02:00 committed by The Qt Project
parent 195c070adf
commit 2d019ddc93

View File

@ -229,6 +229,13 @@
[super touchesEnded:touches withEvent:event];
}
- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event
{
m_touchPressWhileKeyboardVisible = NO;
[self performSelectorOnMainThread:@selector(touchesEndedPostDelivery) withObject:nil waitUntilDone:NO];
[super touchesCancelled:touches withEvent:event];
}
- (void)touchesEndedPostDelivery
{
// Do some clean-up _after_ touchEnd has been delivered to QUIView