Example #1
0
 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);
     }
 }
Example #2
0
        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;
        }