Xamarin Form WebView height as HTML content

where I have a webview that loads an html page with 3 gifs. I would like WebView to become as big as HTML content. Maybe? In WebView, I show some instructions inside the label

  <Grid>
    <Grid>
      <Grid.RowDefinitions>
        <RowDefinition Height="auto"/>
        <RowDefinition Height="*"/>
        <RowDefinition Height="*"/>
      </Grid.RowDefinitions>
      <Grid Grid.Row="0" >
        <Grid.RowDefinitions>
          <RowDefinition/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="*"/>
          <ColumnDefinition Width="*"/>
          <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        ...     
      </Grid>
      <Grid Grid.Row="1">
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
          <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <WebView x:Name="webw1" Grid.Row="0" Grid.Column="0"></WebView>
      </Grid>
      <Grid Grid.Row="2" >
        <Grid.RowDefinitions>
          <RowDefinition/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <ScrollView Grid.Row="0" Grid.Column="0">
          <Label Text="LastExplanation" x:Name="lblLastExplanation" />
        </ScrollView>
      </Grid>
    </Grid>
  </Grid>
</ContentPage>


public FinalCheck()
        {
            InitializeComponent();
            webw1.Source = DependencyService.Get<IBaseUrl>().Get() + "instruction.html";
        }
+4
source share

All Articles