OGeek|极客世界-中国程序员成长平台

标题: javascript - 使用 c# 的 monotouch uiwebview 最简单的 javascript 桥 - xamarin ios [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-13 01:46
标题: javascript - 使用 c# 的 monotouch uiwebview 最简单的 javascript 桥 - xamarin ios

真的很难找到一个有效的解决方案,可以在 monotouch (c#) 和 uiwebview 之间实现 2 路通信。

Android 似乎可以很好地使用 JavaScriptInterface。

(尝试让leaflet.js 在Xamarin IOS uiwebview 组件中工作,并下载geojson,这样我就可以在uiwebview 中填充leaflet.js 并收听来自 native 端的js 回调)。



Best Answer-推荐答案


查看此示例:

https://github.com/xamarin/mobile-samples/tree/master/ContentControls

以及之前关于 StackOverflow 的问题:

How I can call a javascript function with MonoTouch and vice versa?

MonoTouch UIWebView and EvaluateJavascript

或完整的博文:

http://yobriefca.se/blog/2011/12/05/rolling-your-own-phonegap-with-monotouch/

关于javascript - 使用 c# 的 monotouch uiwebview 最简单的 javascript 桥 - xamarin ios,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15658818/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://sqlite.in/) Powered by Discuz! X3.4