Articles in this section
Category / Section

How to create a horizontal listview in Xamarin.Forms?

1 min read

The Xamarin.Forms ListView displays an item in vertical or horizontal view by setting the Orientation property of ListView. The default orientation is vertical. The horizontal listview supports all the essential features such as grouping, swiping, template selector, pull-to-refresh, load more and much more.

xaml

<ContentPage xmlns:sync="clr-namespace:Syncfusion.ListView.XForms;assembly=Syncfusion.SfListView.XForms"
             xmlns:dataSource="clr-namespace:Syncfusion.DataSource;assembly=Syncfusion.DataSource.Portable">
    <ContentPage.Content>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <Grid x:Name="headerGrid" HeightRequest="45">
                <Label Text="Photo Gallery"/>
            </Grid>
            <syncfusion:SfListView x:Name="listView" Orientation="Horizontal"
                                   SelectionMode="None" Grid.Row="1"
                                   ItemsSource="{Binding Gallerynfo}">
                <syncfusion:SfListView.ItemTemplate>
                    <DataTemplate>
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="*" />
                                    <RowDefinition Height="48" />
                                </Grid.RowDefinitions>
                                <Image Source="{Binding Image}" Aspect="Fill"/>
                                <Label Grid.Row="1" Text="{Binding ImageTitle}"/>
                            </Grid>
                    </DataTemplate>
                </syncfusion:SfListView.ItemTemplate>
            </syncfusion:SfListView>
        </Grid>
    </ContentPage.Content>
</ContentPage>

 

Output:

 Horizontal ListView

 

Sample link: 

Horizontal ListView in Xamarin.Forms

Documentation References

The below documentation references will help you further to understand ListView usages,

 

API Documentation - https://help.syncfusion.com/cr/xamarin/Syncfusion.ListView.XForms.html

ListView Getting Started - https://help.syncfusion.com/xamarin/listview/getting-started

Horizontal ListView - https://help.syncfusion.com/xamarin/listview/viewappearance#horizontal-listview

https://help.syncfusion.com/xamarin/listview/viewappearance#horizontal-list-inside-vertical-list

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments
Please sign in to leave a comment
Access denied
Access denied