Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

What do you need to pay attention to when specifying the data source Source for WebView in Xamarin.Forms

Shulou Source: shulou.com Published: 2022-06-01 10:15:06 09月26日 Update

This article will explain in detail what you need to pay attention to when you specify the data source Source for WebView in Xamarin.Forms. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.

Specify the data source Source for WebView in Xamarin.Forms

The web view WebView is used to display HTML and web form content. In this way, the interface can be designed in the form of web pages, which is conducive to update and maintenance. WebView reads content from the data source and displays it. WebView supports three data sources, namely, the web page of the website, the HTML code and the local HTML file. All three forms are set through the Source property. In setting up these three forms of sources, you need to pay attention to the following issues:

First, to use a web page, you need to specify the full path to the page, including the http:// or https:// section.

Second, with HTML code, you need to save the content as a string. When assigning a value, the @ symbol is used for no escape.

Third, local HTML files often refer to other local Javascript and CSS script files, so you need to specify a BaseUrl attribute to indicate the base path to the relative path of these files.

This is the end of this article on "what do you need to pay attention to when you specify a data source for WebView in Xamarin.Forms?". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Tags: Source web page data content file article path three forms code attribute form more website good practical basic character string article way Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi MariaDB MySQL Microsoft vpn