From d586d01562b23bee34a568cc81aa5f9b3a3f9f45 Mon Sep 17 00:00:00 2001 From: LeeCenY <634348197@qq.com> Date: Mon, 27 Nov 2017 15:58:26 +0800 Subject: [PATCH] Fix the iOS 11 keyboard the first time will block the entry Fix the iOS 11 keyboard the first time will block the entry --- .../KeyboardOverlapRenderer.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/KeyboardOverlap/KeyboardOverlap/KeyboardOverlap.Forms.Plugin.iOSUnified/KeyboardOverlapRenderer.cs b/KeyboardOverlap/KeyboardOverlap/KeyboardOverlap.Forms.Plugin.iOSUnified/KeyboardOverlapRenderer.cs index fdaf081..39870ac 100644 --- a/KeyboardOverlap/KeyboardOverlap/KeyboardOverlap.Forms.Plugin.iOSUnified/KeyboardOverlapRenderer.cs +++ b/KeyboardOverlap/KeyboardOverlap/KeyboardOverlap.Forms.Plugin.iOSUnified/KeyboardOverlapRenderer.cs @@ -17,7 +17,6 @@ public class KeyboardOverlapRenderer : PageRenderer NSObject _keyboardHideObserver; private bool _pageWasShiftedUp; private double _activeViewBottom; - private bool _isKeyboardShown; public static void Init () { @@ -58,7 +57,6 @@ void RegisterForKeyboardNotifications () void UnregisterForKeyboardNotifications () { - _isKeyboardShown = false; if (_keyboardShowObserver != null) { NSNotificationCenter.DefaultCenter.RemoveObserver (_keyboardShowObserver); _keyboardShowObserver.Dispose (); @@ -74,10 +72,9 @@ void UnregisterForKeyboardNotifications () protected virtual void OnKeyboardShow (NSNotification notification) { - if (!IsViewLoaded || _isKeyboardShown) + if (!IsViewLoaded) return; - _isKeyboardShown = true; var activeView = View.FindFirstResponder (); if (activeView == null) @@ -100,7 +97,6 @@ private void OnKeyboardHide (NSNotification notification) if (!IsViewLoaded) return; - _isKeyboardShown = false; var keyboardFrame = UIKeyboard.FrameEndFromNotification (notification); if (_pageWasShiftedUp) {