Xamarin WebView Settings Error

Michael Jones 6 Reputation points
2022-01-14T22:32:05.577+00:00

Visual Studio Version: Visual Studio Community 2019

I'm trying to adjust the "Settings" for a Xamarin WebView, although am experiencing an error 'WebView' does not contain a definition for 'Settings'. Please note that all other accessors, variables, and functionalities work with the WebView, it is only the "Settings" that cannot be found. I need to adjust these settings in order to make adjustments to the WebView display. Please see the screenshot below:

165210-webviewsettingserror-20210114.png

I've searched in many places and have been unable to find an occurrence of this error anywhere. I checked the assembly file (via the definition) for WebView and it also does not have a "Settings" property, variable, or function. Many online guides, videos, and tutorials on Xamarin easily reference and access the WebView "Settings", although it doesn't exist for me.

Additional Notes: I have restarted my computer and also created a new Xamarin Mobile project in Visual Studio Community 2022. The error still persists and "Settings" cannot be found.

Developer technologies | .NET | Xamarin
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Michael Jones 6 Reputation points
    2022-01-15T19:06:41.28+00:00

    I resolved this and am now able to access the "Settings" and properties that I was trying to find. I found there were various versions of the "WebView" component. Apparently there is a "Shared" WebView that is generic, and then there are platform specific "WebViews" that are part of separate sub-projects for each device type (android, iOS, etc). I had to create my own I was able to use a project called "JSWebView" as example for each "WebView" type to create a "CustomWebView" and "CustomWebViewRender", here is the link to the sample project: https://github.com/GuyMicciche/JSWebView

    Cheers

    1 person found this answer helpful.

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.