locked
Back botton doesn't support in webview control. RRS feed

  • Question

  • User393741 posted

    Hi, I have pass my complete website on webview, its running file on app..problem is on website there multiple webpages are available and interact with each other, when I navigate one page to other page and press phone back button it exists to me on app not go to previous page. Is there any solution that can be help me to run my website on app.

    Sunday, April 5, 2020 6:57 PM

Answers

  • User382871 posted

    Try to detect the OnBackButtonPressed event of the webView page to check the value of CanGoBack.

    Check the code: <WebView x:Name="webView" Source="https://www.google.com" HeightRequest="300"/> OnBackButtonPressed event: protected override bool OnBackButtonPressed() { if (webView.CanGoBack) { webView.GoBack(); return true; } return false; }

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Monday, April 6, 2020 2:03 AM

All replies

  • User382871 posted

    Try to detect the OnBackButtonPressed event of the webView page to check the value of CanGoBack.

    Check the code: <WebView x:Name="webView" Source="https://www.google.com" HeightRequest="300"/> OnBackButtonPressed event: protected override bool OnBackButtonPressed() { if (webView.CanGoBack) { webView.GoBack(); return true; } return false; }

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Monday, April 6, 2020 2:03 AM
  • User393741 posted

    Thanks Jarvan

    Monday, April 6, 2020 4:20 AM