2
在iPhone我簡單地做到這一點(和它完美的作品):的Android捏/雙指上視圖旋轉
view.transform = CGAffineTransformRotate(變換,[(UIRotationGestureRecognizer *)識別旋轉]);
我當然期待在Android方面做更多的工作(像往常一樣)。我注意到Android沒有雙手旋轉手勢檢測器。有關我如何實現這種行爲的任何想法?
這是我用我的捏規模探測器:
private class ScaleListener extends ScaleGestureDetector.SimpleOnScaleGestureListener {
@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));
invalidate();
return true;
}
}
在這裏您可以找到[RotateGestureDetector](https://code.google.com/p/rosjava/source/browse/android_honeycomb_mr2/src/org/ros/android/view/visualization/RotateGestureDetector(未經測試)的.java?規格= svn.android.e76dac9e27992b33a1c8903ceb0f2ab08fe55b38及回購= Android和R = d006dfeaf30051cb7e9feb8211f1f20a6a01fac1) – naufraghi