Xamarin Forms: resizing scrollview to translateeto

I am trying to do the following:

I have a scrollview inside my view and the height is 2/9 of the parent height. Then the user can translate this scroll to enlarge it. However, the scrollview size does not change explicitly. Therefore, even if it is larger, the scroll size remains the same, killing the point. At first I could do it a little more. However, it will not scroll, as the size is large enough not to scroll.

I do not know if this could explain. Hope I did.

Sincerely.

Edit -------------

Some code to explain my point further

This is scrollview

public class TranslatableScrollView : ScrollView
{
        public Action TranslateUp { get; set; }
        public Action TranslateDown { get; set; }
        bool SwipedUp;
    public TranslatableScrollView()
    {
        SwipedUp = false;
        Scrolled += async delegate {
            if (!SwipedUp && ScrollY > 0) {
                TranslateUp.Invoke ();
                SwipedUp = true;
            } else if (SwipedUp && ScrollY <= 0) {

                TranslateDown.Invoke ();
                SwipedUp = false;
            }
        };
    }
}

And this is the code on the page

sv_footer = new TranslatableScrollView {
                    Content = new StackLayout {
                        VerticalOptions =         LayoutOptions.FillAndExpand,
                        HorizontalOptions = LayoutOptions.FillAndExpand,
                        Children = {
                            l_details,
                            l_place
                        },
                    }
                };
sv_footer.TranslateUp += new Action (async delegate {

                Parent.ForceLayout();
                await cv_scrollContainer.TranslateTo(0, -transX, aSpeed, easing);
            });

sv_footer.TranslateDown += new Action (async delegate {
                await cv_scrollContainer.TranslateTo(0, 0, aSpeed, easing);
            });

cv_scrollContainer = new ContentView {
                Content = sv_footer,
                VerticalOptions = LayoutOptions.Fill
            };

scrollview contentview, 0, . : Xamarin Forms: ScrollView TranslateTo

+4
1

, translateTo . scaleTo . . - Xamarin LayoutTo, . layoutTo . Rectangle.

+2

Source: https://habr.com/ru/post/1618548/


All Articles