Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

How to add 2 rows of images using collectionview

$
0
0

l have a row of images created using collectionview as per the code below.

<CollectionView ItemsSource="{Binding sliders}" 
            HorizontalOptions="CenterAndExpand" HeightRequest="150" >
<CollectionView.ItemsLayout>
    <ListItemsLayout>
        <x:Arguments>
            <ItemsLayoutOrientation>Horizontal</ItemsLayoutOrientation>    
        </x:Arguments>
    </ListItemsLayout>           
 </CollectionView.ItemsLayout>        
<CollectionView.ItemTemplate>
    <DataTemplate>
        <Grid BackgroundColor="#282626" Padding="0,5,0,0" >
            <Grid.RowDefinitions >
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
                <Image Source="{Binding Url}"
                   Aspect="AspectFill"
                   HeightRequest="160"
                   WidthRequest="160" 
                   Grid.Row="0"
                   VerticalOptions="CenterAndExpand"
                   HorizontalOptions="CenterAndExpand"/>
                <Label Text="{Binding Name}" TextColor="White" />       
            </Grid>
        </DataTemplate>
    </CollectionView.ItemTemplate>
</CollectionView>

How can l add another row of images and label to the row.the images has to be different.Kindly view the attached image to get a picture of what l want to achieve.Please help


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>