0
在我的地圖,我想用ScaleGestureDetector
捕捉/放大,但我從來沒有接收任何回調至任一onScale
或onScaleBegin
或onScaleEnd
。谷歌手機地圖的兩個手指捏/拉伸回調
在我的片段的onCreateView
,我初始化:
scaleGestureDetector = new ScaleGestureDetector(getContext(), new simpleOnScaleGestureListener());
我實現像這樣的回調:
public class simpleOnScaleGestureListener extends
SimpleOnScaleGestureListener {
@Override
public boolean onScale(ScaleGestureDetector detector) {
// TODO Auto-generated method stub
startScale = detector.getScaleFactor();
Log.d(TAG, "::onScale:: " + detector.getScaleFactor());
return true;
}
@Override
public boolean onScaleBegin(ScaleGestureDetector detector) {
// TODO Auto-generated method stub
Log.d(TAG, "::onScaleBegin:: " + detector.getScaleFactor());
return true;
}
@Override
public void onScaleEnd(ScaleGestureDetector detector) {
// TODO Auto-generated method stub
Log.d(TAG, "::onScaleEnd:: " + detector.getScaleFactor());
endScale = detector.getScaleFactor();
}
而且,是不是可以認爲回調將不斷呼籲每當用戶放大/縮小?