public KeyboardInsetTracker(UIScrollView targetView, Func <UIWindow> fetchWindow, Action <UIEdgeInsets> setInsetAction, Action <PointF> setContentOffset, IPlatformViewHandler renderer) { _setContentOffset = setContentOffset; _targetView = targetView; _fetchWindow = fetchWindow; _setInsetAction = setInsetAction; Controls.Compatibility.Platform.iOS.KeyboardObserver.KeyboardWillShow += OnKeyboardShown; Controls.Compatibility.Platform.iOS.KeyboardObserver.KeyboardWillHide += OnKeyboardHidden; if (renderer != null) { _shellScrollViewTracker = new ShellScrollViewTracker(renderer); } }
public void Dispose() { if (_disposed) { return; } _disposed = true; Controls.Compatibility.Platform.iOS.KeyboardObserver.KeyboardWillShow -= OnKeyboardShown; Controls.Compatibility.Platform.iOS.KeyboardObserver.KeyboardWillHide -= OnKeyboardHidden; _shellScrollViewTracker?.Dispose(); _shellScrollViewTracker = null; }