AndreiMisiukevich / CardView

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

HtmlLabel in CarouselView #386

Closed mergehez closed 3 years ago

mergehez commented 3 years ago

The html is not loaded well when I swipe twice. The line breaks don't work.

<StackLayout AbsoluteLayout.LayoutBounds="0,0,1,1" AbsoluteLayout.LayoutFlags="All">
    <cards:CarouselView 
        ItemsSource="{Binding Items}"
        SelectedIndex="{Binding CurrentIndex}"
        VerticalOptions="FillAndExpand">
        <cards:CarouselView.ItemTemplate>
            <DataTemplate x:DataType="models:Item">
                <ContentView >
                    <StackLayout HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
                        <htmlLabel:HtmlLabel Text="{Binding HtmlContent}" 
                                             VerticalOptions="FillAndExpand" 
                                             HorizontalOptions="FillAndExpand" 
                                             Margin="10"/>
                    </StackLayout>
                </ContentView>
            </DataTemplate>
        </cards:CarouselView.ItemTemplate>
    </cards:CarouselView>
</StackLayout>
mergehez commented 3 years ago

I figured out that the problem is not CarouselView, it is HtmlLabel... If possible, please delete this issue...