From b705262b098c9464d67b5e3f0a40c3eb371ea9e4 Mon Sep 17 00:00:00 2001 From: Jozef Legény Date: Wed, 5 Sep 2018 06:41:01 +0200 Subject: IOS: Hide keyboard when rotating to landscape On iOS12 at least, the rotation did not force the keyboard to hide. This fix will force it to be retracted in landscape and restored when rotating back to the portrait position. --- backends/platform/ios7/ios7_video.mm | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'backends') diff --git a/backends/platform/ios7/ios7_video.mm b/backends/platform/ios7/ios7_video.mm index ee558a16c1..7ce19f1f4b 100644 --- a/backends/platform/ios7/ios7_video.mm +++ b/backends/platform/ios7/ios7_video.mm @@ -870,6 +870,13 @@ uint getSizeNextPOT(uint size) { - (void)deviceOrientationChanged:(UIDeviceOrientation)orientation { [self addEvent:InternalEvent(kInputOrientationChanged, orientation, 0)]; + + BOOL isLandscape = (self.bounds.size.width > self.bounds.size.height); + if (isLandscape) { + [_keyboardView hideKeyboard]; + } else { + [_keyboardView showKeyboard]; + } } - (UITouch *)secondTouchOtherTouchThan:(UITouch *)touch in:(NSSet *)set { -- cgit v1.2.3