我正在使用 webiview,并且我覆盖了 onTouchEvent,而不是内置缩放控件不起作用。
wv.setOnTouchListener(new OnTouchListener()
{
public boolean onTouch(View arg0, MotionEvent arg1)
{
if(arg1.getAction()==MotionEvent.ACTION_DOWN)
{
x_down = (int) arg1.getX();
y_down = (int) arg1.getY();
Log.v("log", "x pos is "+x_down +"y pos is "+y_down);
}
else if(arg1.getAction()==MotionEvent.ACTION_UP)
{
x_up = (int) arg1.getX();
y_up = (int) arg1.getY();
Log.v("log", "x pos is "+x_up +"y pos is "+y_up);
if((x_down-x_up)>30)
{
wv.loadData("<img src=\"myurl_1\">", "text/html", null);
}
else if((x_up-x_down)>30)
{
wv.loadData("<img src=\"myurl_2\">", "text/html", null);
}
}
return true;
}
});
提前致谢...