码迷,mamicode.com
首页 > Web开发 > 详细

Xamarin使用笔记之WebView

时间:2017-06-07 17:03:00      阅读:290      评论:0      收藏:0      [点我收藏+]

标签:rip   ges   new   set   tle   script   code   todo   div   

一、事件调用

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

标签:rip   ges   new   set   tle   script   code   todo   div   

原文地址:http://www.cnblogs.com/vipstone/p/6957535.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!