I am currently working on an app feature where I need to show text in HTML format from server side coming via REST APIs.
The size of the text/html content varies per row and I trying to show the data in a scroll view containing multiple WebViews inside a big stack layout
My single row component looks like this,
<ContentView x:Name="RowComponent">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Label Grid.Row=0/>
<Label Grid.Row=1/>
<WebView Grid.Row=2>
<WebView.Source>
<HtmlWebViewSource Html="{Binding FormattedMessage}" />
</WebView.Source>
</WebView>
</Grid>
<ContentView>
And also the rows are repeated inside a content page like the following,
<ContentPage>
<ScrollView>
<StackLayout>
<StackLayout>
<StackLayout />
<StackLayout>
<!-- Inside this there are multiple rows of the above component '**RowComponent**' -->
</StackLayout>
</StackLayout>
<StackLayout/>
</StackLayout>
</ScrollView>
</ContentPage>
According to the Xamarin Forms documentation about WebView: "Grid without WidthRequest & HeightRequest. Grid is one of the few layouts that does not require specifying requested heights and widths." (Xamarin.Forms WebView Layout)
However, the WebView is not even showing up or showing any content. How can I fix this?
Thank you in advance.