On galaxy S the zoom controls work on multitouch, but on HTC Legend, t开发者_如何学Che same code doesnt work. What is the matter?
There is something going on with the HTC legend and multitouch. see this -i agree, rather messy- link: http://www.htclegendforum.com/htc-legend-general-discussion/only-%27pinch-to-zoom%27-no-tual-touch-no-multi-touch/
As I understand it, the HTC legend supports only 'pinch to zoom', not real multitouch.
Htc has done some changes in their webview implementation and that requires to call some API to make pinch to zoom working on those phones. Try following:
_webView.getSettings().setBuiltInZoomControls(true);
try {
Method m = _webView.getClass().getMethod("enableMultiTouch",
null);
if (m != null) {
m.invoke(_webView, null);
}
} catch (Exception e) {
//e.printStackTrace();
}
try {
Method m = _webView.getClass().getMethod(
"enableMultiTouchTextRelow", boolean.class);
if (m != null) {
m.invoke(_webView, false);
}
} catch (Exception e) {
//e.printStackTrace();
}
try {
Method m = _webView.getClass().getMethod(
"setIsCacheDrawBitmap", boolean.class);
if (m != null) {
m.invoke(_webView, false);
}
} catch (Exception e) {
// e.printStackTrace();
}
// Must for HTC EVO to do text reflow after double tap
try {
Method m = _webView.getClass().getMethod("enableSmartZoom",
null);
if (m != null) {
m.invoke(_webView, null);
}
} catch (Exception e) {
// e.printStackTrace();
}
精彩评论