Example #1
0
        public static void AdjustHeaderPosition(UIScrollView scrollView, nfloat headerHeight, bool animation)
        {
            var scrollViewOffset = scrollView.ActualContentOffset();

            if (scrollViewOffset < 0 || scrollView.Decelerating)
            {
                return;
            }

            if (scrollViewOffset < headerHeight / 2)
            {
                scrollView.SetActualContentOffset(0, animation);
            }
            else if (scrollViewOffset < headerHeight)
            {
                scrollView.SetActualContentOffset(headerHeight, animation);
            }
        }