From d2ded404bbb553bfa1c4f134ef86de84cbed6baa Mon Sep 17 00:00:00 2001 From: Andrey Filipenkov Date: Thu, 22 Sep 2022 14:07:41 +0300 Subject: [PATCH] use system background color for the keyboard textfield fix kambala-decapitator/vcmi#45 --- client/ios/startSDL.mm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/ios/startSDL.mm b/client/ios/startSDL.mm index 3dec2f3b6..1a89ac4a7 100644 --- a/client/ios/startSDL.mm +++ b/client/ios/startSDL.mm @@ -44,9 +44,13 @@ auto r = textField.frame; r.size.height = 40; textField.frame = r; - textField.backgroundColor = UIColor.whiteColor; self.gameChatHandler.textFieldSDL = textField; + if(@available(iOS 13.0, *)) + textField.backgroundColor = UIColor.systemBackgroundColor; + else + textField.backgroundColor = UIColor.whiteColor; + auto longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleLongPress:)]; longPress.minimumPressDuration = 0.2; [view addGestureRecognizer:longPress];