Xamarin使用筆記之WebView
阿新 • • 發佈:2017-06-07
alert eval cti .html ges mage strong 事件 eva
一、事件調用
1.Xamarin調用webview事件:
WebView展示的代碼如下:
var htmlSource = new HtmlWebViewSource(); htmlSource.Html = @"<html> <head> <meta charset=‘UTF-8‘> <title></title> <script> function showMsg(msg){ alert(‘hello ‘+msg); } </script> </head> <body> 你好世界. </body> </html>"; this.webview.Source = htmlSource;
調用核心代碼:
this.wv.Eval("showMsg(‘王磊‘)");
效果如下:
2.webview調用Xamarin事件:
//todo
Xamarin使用筆記之WebView