How to create layout List/GridView in CarouselView?

Liêm_NguyễnLiêm_Nguyễn USMember ✭✭✭✭

How to create a ListView or GridView inside CarouselView like this link

Tagged:

Best Answer

Answers

  • LeonLuLeonLu Member, Xamarin Team Xamurai

    You can use this plugin https://github.com/alexrainman/CarouselView, then add the layout in the ViewCell


    <controls:CarouselViewControl.ItemTemplate>

                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="*" />
                                    <RowDefinition Height="*" />
                                    <RowDefinition Height="*" />
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*" />
    
                                </Grid.ColumnDefinitions>
                                <StackLayout  Grid.Row="0" Grid.Column="0" >
                                    <Label Text="{Binding item1}"/>
                                    <Label Text="{Binding item2}"/>
                                </StackLayout>
                                <StackLayout  Grid.Row="1" Grid.Column="0">
                                    <Label Text="{Binding item3}"/>
                                    <Label Text="{Binding item4}"/>
                                </StackLayout>
                                <StackLayout  Grid.Row="2" Grid.Column="0">
                                    <Label Text="{Binding item5}"/>
                                    <Label Text="{Binding item6}"/>
                                </StackLayout>
    
    
                            </Grid>
    
                        </ViewCell>
        </DataTemplate>
    </controls:CarouselViewControl.ItemTemplate>
    

  • Liêm_NguyễnLiêm_Nguyễn USMember ✭✭✭✭
    edited June 18

    Thank for you reply!
    I must manually set every item for all column and row?
    I have total 30 item need to put in a Grid. 3 Item in a row total 10 column

  • Liêm_NguyễnLiêm_Nguyễn USMember ✭✭✭✭

    @LeonLu said:


    Example: I have 30 items. How to Bind every Item to correct position.

  • Liêm_NguyễnLiêm_Nguyễn USMember ✭✭✭✭

    @LeonLu said:
    If you a have 30 Items, I suggest you to use HorizontalListview to achieve that like this link.https://www.sharpnado.com/a-real-horizontal-list-view/

    Thank you!

Sign In or Register to comment.