AndreiMisiukevich / CardView

CardsView | CarouselView | CoverflowView | CubeView for Xamarin.Forms
MIT License
710 stars 114 forks source link

Label in CardView #364

Closed p0dgana closed 3 years ago

p0dgana commented 3 years ago

I was wondering if it's possible to add label to the cardview below the image?

<ContentPage.Content>
        <cards:CardsView x:Name="cardView">
            <cards:CardsView.ItemTemplate>
                <DataTemplate>
                    <ContentView>
                        <Frame 
                    VerticalOptions="Center"
                    HorizontalOptions="Center"
                    HeightRequest="300"
                    WidthRequest="300"
                    Padding="0" 
                    HasShadow="false"
                    IsClippedToBounds="true"
                    CornerRadius="10"
                    BackgroundColor="White">
                            <Image Source="{Binding t_slika}"/>
                        </Frame>
                    </ContentView>
                </DataTemplate>
            </cards:CardsView.ItemTemplate>
            <controls:LeftArrowControl/>
            <controls:RightArrowControl/>
            <controls:IndicatorsControl/>
        </cards:CardsView>
    </ContentPage.Content>
</ContentPage>
AndreiMisiukevich commented 3 years ago

Hi, yes, it's possible. You can build any layout you wish. Just use StackLayout. I don't know how exactly do you want to place the views, but something like this will work.

        <cards:CardsView>
            <cards:CardsView.ItemTemplate>
                <DataTemplate>
                    <StackLayout>
                        <Image Source="{Binding ImageSource}"/>
                        <Label Text="SOME TEXT HERE />
                    </StackLayout>
                </DataTemplate>
            </cards:CardsView.ItemTemplate>
        </cards:CardsView>
p0dgana commented 3 years ago

Thank you!