Hello,
Welcome to our Microsoft Q&A platform!
As a test, I modified your code as follows and I set the height of WebView
to 1000
:
<ScrollView Grid.Row="0" Margin="0" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" >
<StackLayout HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
<Label x:Name="LabelNewsTitle" Margin="10" FontSize="Large" FontAttributes="Bold" Text="LabelNewsTitle"/>
<Label x:Name="LabelNewsSource" Text="LabelNewsSource"/>
<Label x:Name="LabelNewsDate" Text="LabelNewsDate" />
<WebView x:Name="WebViewNewsArticle" HeightRequest="1000" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" BackgroundColor="Green" />
</StackLayout>
</ScrollView>
In MainPage.xaml.cs
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
WebViewNewsArticle.Source = new HtmlWebViewSource
{
Html = @"<!DOCTYPE html><html><head><style>img { width:100%; }</style></head><body>" + "test page" + @"</body></html>",
};
}
}
The WebView
in above code could scroll properly.
So I guess the height of your WebView is enough to display on one screen, without scrolling at all.
Best Regards,
Jessie Zhang
---
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.