Forum Xamarin.Forms
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

ListView, How can I find out when ListView is scrolled to the middle ?

OleksandrMyronchukOleksandrMyronchuk Member ✭✭
edited April 14 in Xamarin.Forms

I want to call one method when the ListView is scrolled to the middle.

I have the ListView

        `<ListView x:Name="myListView">
        ...
        </ListView>`

This ListView have a subscriber

myListView.Scrolled += ScrolledListener;

The myListView.Scrolled listener:

    `public void ScrolledListener(object sender, ScrolledEventArgs args)
    {
    ...
    var scrollView = (ListView)sender;
                bool isNeededMoreParticipants =
                    args.ScrollY >
                    (int)(scrollView.Height - scrollView.Height / 2); //Height - is not what I expected. I need the maximum size of ScrollY
    ...
    }`

How can I find out when ListView is scrolled to the middle ?

Best Answers

Answers

Sign In or Register to comment.