示例#1
0
 public KeyboardInsetTracker(UIScrollView targetView, Func <UIWindow> fetchWindow, Action <UIEdgeInsets> setInsetAction, Action <PointF> setContentOffset, IVisualElementRenderer renderer)
 {
     _setContentOffset = setContentOffset;
     _targetView       = targetView;
     _fetchWindow      = fetchWindow;
     _setInsetAction   = setInsetAction;
     KeyboardObserver.KeyboardWillShow += OnKeyboardShown;
     KeyboardObserver.KeyboardWillHide += OnKeyboardHidden;
     if (renderer != null)
     {
         _shellScrollViewTracker = new ShellScrollViewTracker(renderer);
     }
 }
示例#2
0
        public void Dispose()
        {
            if (_disposed)
            {
                return;
            }

            _disposed = true;

            KeyboardObserver.KeyboardWillShow -= OnKeyboardShown;
            KeyboardObserver.KeyboardWillHide -= OnKeyboardHidden;

            _shellScrollViewTracker?.Dispose();
            _shellScrollViewTracker = null;
        }