如何使用PhoneGap中的本机控件插件将不同的页面加载到UIWebView中
我正在使用 NativeControls 插件创建一个标签栏 - http://d.pr/vBJZ
显然,首先加载,选项卡附加了 onSelect 事件,我可以通过执行 window.location="http://someremotedomain.com" 来刷新 webview。
但是,一旦 web 视图刷新了新的外部页面 - 选项卡栏似乎就失去了 onSelect 事件。
我想我真正的问题是 - 当 webbview 开始显示不同的(远程/外部)页面时,为什么选项卡按钮会丢失其 onSelect 事件?
这是否意味着我必须在每个新页面上重新初始化 NativeControls?这是不可能的,因为我显示的页面来自外部源,其中不包含与phonegaps js相关的文件。
我的第二个问题 - 可能会帮助我解决困境,有什么方法可以获取 UIWebView 控件吗?
I'm using the NativeControls plugin to create a tabbar - http://d.pr/vBJZ
Apparently, on first load, the tabbar has the onSelect event attached to them and i can refresh the webview just fine by doing window.location="http://someremotedomain.com".
But once the webview refreshed with the new external page - it seems the tabbar loses its onSelect event.
I suppose my real question is - why does the tabbar buttons loses its onSelect Event when the webbview starts to show a different (remote/external)page?
Does that mean that i have to re initialize the NativeControls on every new page? that isn't possible because the page im showing is coming from an external source, which doesn't include the phonegaps js related files.
My 2nd question - probably would help me dilemma, is there any way to grab the UIWebView control?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,没关系,我发现:
下一页上不再存在 javascript 回调函数
是的,你可以 - 但我不'不知道在js文件中,但在plugin/obj-c中你可以访问webview
okay nevermind i figured out:
the javascript callback function doesn't exist anymore on the next page
yes you can - but i don't know in the js file but in the plugin/obj-c you can access the webview