예제 #1
0
        protected virtual void SetUpNewElement(ItemsView newElement)
        {
            if (newElement == null)
            {
                return;
            }

            UpdateLayout();
            ItemsViewController = CreateController(newElement, _layout);

            if (Forms.IsiOS11OrNewer)
            {
                // We set this property to keep iOS from trying to be helpful about insetting all the
                // CollectionView content when we're in landscape mode (to avoid the notch)
                // The SetUseSafeArea Platform Specific is already taking care of this for us
                // That said, at some point it's possible folks will want a PS for controlling this behavior
                ItemsViewController.CollectionView.ContentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentBehavior.Never;
            }

            SetNativeControl(ItemsViewController.View);
            ItemsViewController.CollectionView.BackgroundColor = UIColor.Clear;
            ItemsViewController.UpdateEmptyView();
            ItemsViewController.UpdateFooterView();
            ItemsViewController.UpdateHeaderView();

            UpdateHorizontalScrollBarVisibility();
            UpdateVerticalScrollBarVisibility();

            // Listen for ScrollTo requests
            newElement.ScrollToRequested += ScrollToRequested;
        }
예제 #2
0
        protected virtual void SetUpNewElement(ItemsView newElement)
        {
            if (newElement == null)
            {
                return;
            }

            _layout             = SelectLayout(newElement.ItemsLayout);
            ItemsViewController = CreateController(newElement, _layout);
            SetNativeControl(ItemsViewController.View);
            ItemsViewController.CollectionView.BackgroundColor = UIColor.Clear;
            ItemsViewController.UpdateEmptyView();

            // Listen for ScrollTo requests
            newElement.ScrollToRequested += ScrollToRequested;
        }