WebView Height in Xamarin Forms

This is how you set the height and width to fill the screen in your Xamarin Forms app.

    1. Using Xamarin Essentials, get the device’s height and width.
    2. var mainDisplayInfo = DeviceDisplay.MainDisplayInfo;
                  var DeviceHeight = mainDisplayInfo.Height;
                  var DeviceWidth = mainDisplayInfo.Width;
  1. Then assign those variables to your WebView.
  2. xamarin forms fullscreen webview
  3. You can set it in Xaml
  4. Or in Code behind i.e.  myWebview.heightRequest = DeviceHeight.

< WebView Navigated="WebView_Navigated" Navigating="WebView_Navigating" HeightRequest="{Binding DeviceHeight}" WidthRequest="{Binding DeviceWidth}">
</ WebView>