我在ScaleGestureDetector
上有ImageView
用于缩小缩放功能。但是默认情况下,缩小功能可以在两根手指之间保持一定距离。要再次缩小,我必须再次开始缩小。如何克服这两个手指的距离限制?这样我的缩小效果会很流畅。
@Override
public boolean onScale(ScaleGestureDetector detector) {
mScaleFactor = detector.getScaleFactor();
// Don't let the object get too small or too large.
// mScaleFactor = Math.max(0.1f, Math.min(mScaleFactor, 5.0f));
scaleImage(mScaleFactor, detector.getFocusX(), detector.getFocusY(), true);
invalidate();
//matrix.setScale(detector.getScaleFactor(),detector.getScaleFactor());
return true;
}