|
2 | 2 |
|
3 | 3 | This example demonstrates how to create a horizontal listview using Xamarin.Forms SfListView. |
4 | 4 |
|
| 5 | +## Sample |
| 6 | +```xaml |
| 7 | + <Grid> |
| 8 | + <syncfusion:SfListView x:Name="listView" |
| 9 | + Orientation="Horizontal" |
| 10 | + ItemsSource="{Binding Gallerynfo}"> |
| 11 | + |
| 12 | + <syncfusion:SfListView.ItemTemplate> |
| 13 | + <DataTemplate> |
| 14 | + <Frame BackgroundColor="#EEEEEE" Padding="2"> |
| 15 | + <Frame.HasShadow> |
| 16 | + <OnPlatform x:TypeArguments="x:Boolean"> |
| 17 | + <On Platform="Android" Value="True"/> |
| 18 | + <On Platform="UWP" Value="True"/> |
| 19 | + <On Platform="iOS,macOS" Value="False"/> |
| 20 | + </OnPlatform> |
| 21 | + </Frame.HasShadow> |
| 22 | + <Grid RowSpacing="0" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand"> |
| 23 | + <Grid.RowDefinitions> |
| 24 | + <RowDefinition Height="*" /> |
| 25 | + <RowDefinition Height="48" /> |
| 26 | + </Grid.RowDefinitions> |
| 27 | + <Image Source="{Binding Image}" Aspect="Fill"/> |
| 28 | + <Label Grid.Row="1" Text="{Binding ImageTitle}" |
| 29 | + LineBreakMode="WordWrap" |
| 30 | + HorizontalTextAlignment="Start" |
| 31 | + VerticalTextAlignment="Center" |
| 32 | + TextColor="Black" Opacity="0.87" |
| 33 | + Margin="16,0,0,0" FontSize="16"> |
| 34 | + </Label> |
| 35 | + </Grid> |
| 36 | + </Frame> |
| 37 | + </DataTemplate> |
| 38 | + </syncfusion:SfListView.ItemTemplate> |
| 39 | + </syncfusion:SfListView> |
| 40 | + </Grid> |
| 41 | +``` |
| 42 | + |
5 | 43 | See [How to create a horizontal listview in Xamarin.Forms](https://www.syncfusion.com/kb/9631/how-to-create-a-horizontal-listview-in-xamarin-forms) for more details. |
6 | 44 | ## <a name="requirements-to-run-the-demo"></a>Requirements to run the demo ## |
7 | 45 |
|
|
0 commit comments