public class MyWebView extends WebView {
private long last_time = 0L;
public MyWebView(Context context) {
super(context);
}
public MyWebView(Context context, AttributeSet attrs) {
super(context, attrs);
}
@Override
public boolean onTouchEvent(MotionEvent event) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
long current_time = System.currentTimeMillis();
long d_time = current_time - last_time;
// System.out.println(d_time);
if (d_time < 300) {
last_time = current_time;
return true;
} else {
last_time = current_time;
}
break;
}
return super.onTouchEvent(event);
}
}
Android webview 如何禁止双击缩放
最新推荐文章于 2024-07-19 21:03:25 发布