Deepak
Deepak

Reputation: 575

How to hide the list view above content while scrolling down the list in Xamarin forms

I have tried to hide the List View above design while scrolling down the List view. In my page I have image, entry, button and List view presented vertically, While user is try to scroll down the List view, design above the list is need to hide and if he try to scrolling up List view, the design is unhide is my requirement. Please suggest any idea to achieve this functionality. Thanks in advance.

Upvotes: 0

Views: 709

Answers (1)

Ilia Stoilov
Ilia Stoilov

Reputation: 632

Look at the Header property of the list view. It does exactly what you want to achieve. You have to put the visual elements (image, entry, button & etc.) that you want to hide in the header of the list view (for example grouped in a stack layout).

    Label lblExample = new Label
    {
        Text = "Label",
    };

    Button btnExample = new Button
    {
        Text = "Button",
    };

    StackLayout stackHeader = new StackLayout
    {
        Children =
        {
            lblExample,
            btnExample
        }
    };

    ListView listView = new ListView
    {
        Header = stackHeader,
    };

Upvotes: 1

Related Questions