如果你想真正做一个差异,我建议你我的方法:
我做了一个JavaScript可调用的函数来创建另一个WebView(“儿童webvie W“),我会用像一个iframe,与内容填充,所以从JS应用程序,我可以这样做:
insertWebView (x,y,w,h,"<div>.......</div>").
你必须做一些一次性的工作,stabilish办法comunicate两个网页视图,但你明白了。请在下面找到附件中我的insertWebView函数的来源以获取灵感。
这个改进非常棒,因为那些小巧的iframe-webviews不仅表现出色,而且像萤光过度滚动,多点触控(现在它们是不同的网页浏览器!)等提供了接近本地的体验。
我也做了一个扩展使用本地拖放之间的webviews。
也许这不是很有效的记忆方式,但在用户体验方面相信我这是值得的努力,千次。
好运!
public void insertWebView(int code, int x0, int y0, int w, int h, String url, int vertical, String initContent, String params, int alpha, int rot, int screenId) {
PlasmaWebView webview1 = getWebView(code);
if (webview1 != null) {
if (Conf.LOG_ON) Log.d(TAG, "WEBVIEW: Reusing webview " + code + " at " + x0 + "," + y0 + "," + w + "," + h + " vertical " + vertical+", rot="+rot);
webview1.setVerticalScrollBarEnabled(vertical == 1);
webview1.setHorizontalScrollBarEnabled(vertical != 1);
webview1.move(x0, y0, w, h, Funq.this);
if ((alpha>0) && (alpha<100)) webview1.setAlpha((float)alpha/100);
webview1.setRotation((float)rot/10);
webview1.handleTemplateLoad(url, initContent);
return;
}
if (Conf.LOG_ON) Log.d(TAG, "WEBVIEW: Insert webview " + code + " at " + x0 + "," + y0 + "," + w + "," + h + " vertical " + vertical + " url " + url+" alpha "+alpha+", rot="+rot);
webview1 = new PlasmaWebView(Funq.this.getBaseContext(), code, vertical==1, useHardware, jvs, screenId);
if ((alpha>0) && (alpha<100)) webview1.setAlpha((float)alpha/100);
webview1.setRotation((float)rot/10);
RelativeLayout.LayoutParams p=webview1.createLayout(x0, y0, w, h, Funq.this);
layerContainer.addView(webview1, p);
webview1.handleTemplateLoad(url, initContent);
}
你可能会在这里找到一些答案:http://touchpunch.furf.com/ – EliSherer