0

我在看ScaleGestureDetector课。http://developer.android.com/reference/android/view/ScaleGestureDetector.html

我有两种方法可以做到Zoom-In and ZoomOut。我应该重写哪个方法来调用这两种方法。

private class ScaleListener extends ScaleGestureDetector.SimpleOnScaleGestureListener {@
    Override
    public boolean onScale(ScaleGestureDetector detector) {

        return true;
    }

    Override
    public boolean  onScaleBegin(ScaleGestureDetector detector) {

        return true;
    }

    Override
    public boolean  onScaleEnd(ScaleGestureDetector detector) {

    }
}

让我们采取当我做一个捏,我想打电话Zoom-In和捏我想打电话Zoom-out

4

1 回答 1

0

您需要通过在方法内部调用ScaleGestureDetecteor.getScaleFactor()onScale来获取比例因子。如果小于一,则缩小,否则 - 放大

于 2013-05-14T14:36:29.707 回答