Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/wcf/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用HTML访问Xamarin.Forms中的图像?_Html_Xamarin_Xamarin.forms - Fatal编程技术网

如何使用HTML访问Xamarin.Forms中的图像?

如何使用HTML访问Xamarin.Forms中的图像?,html,xamarin,xamarin.forms,Html,Xamarin,Xamarin.forms,我正在尝试使用下面的HTML代码访问Xamarin.Forms中的图像。DIV标记内的文本将显示在emulator中,但图像不会出现 var htmlSource = new HtmlWebViewSource(); htmlSource.Html = @"<html> <head> <link rel=""stylesheet"" href=""style.css""> </head> <body> <img

我正在尝试使用下面的HTML代码访问Xamarin.Forms中的图像。DIV标记内的文本将显示在emulator中,但图像不会出现

var htmlSource = new HtmlWebViewSource();

htmlSource.Html = @"<html>
<head>
    <link rel=""stylesheet"" href=""style.css"">
</head>
<body>
    <img img src='world_bank.png'/>
    <div>Helloooo</div>
    </body>
</html>";

webVieew.Source = htmlSource;
var htmlSource=new HtmlWebViewSource();
htmlSource.Html=@”
你好
";
webview.Source=htmlSource;

您的标记中有一个双
img
元素要添加到@SushiHangover的注释中,您的
src
属性使用的是无效的html单引号。这也需要以与样式表中相同的方式使用双引号。谢谢,它使用双引号工作,但图像需要位于Droid-->资产文件夹中,然后才可以工作。