예제 #1
0
        private void ScrollRoot_Scrolled(object sender, ScrolledEventArgs e)
        {
            if (isAnimating)
            {
                return;
            }

            if (e.ScrollY > ScrollMaxLimit)
            {
                if (HeaderView.HeightRequest <= 0)
                {
                    isAnimating = true;

                    HeaderView.Animate("show", (height) =>
                    {
                        HeaderView.HeightRequest = height;
                    },
                                       start: 0, end: headerContentHeight, easing: Easing.CubicIn, finished: (d, b) =>
                    {
                        isAnimating = false;
                    });
                }
            }
            else
            {
                if (HeaderView.HeightRequest > 0)
                {
                    isAnimating = true;

                    HeaderView.Animate("hide", (height) =>
                    {
                        HeaderView.HeightRequest = height;
                    },
                                       start: HeaderView.HeightRequest, end: 0, easing: Easing.CubicOut, finished: (d, b) =>
                    {
                        isAnimating = false;
                    });
                }
            }
        }