2015-01-14 24 views
1

的doubletap我想的onCreate()doubletap如何覆蓋的PhotoView

後設置規模= 4:

  imageView = (ImageView)rootView.findViewById(R.id.imageView1); 
     mAttacher = new PhotoViewAttacher(imageView); 
     imageLoader.displayImage(globalWallImages.get(position).preview, imageView, options); 
     mAttacher.setOnDoubleTapListener(this); 

我設置mAttacher.setOnDoubleTapListener(this); 並在此接口的方法做:

public boolean onDoubleTap(MotionEvent e) { 
     Log.e("","onDoubleTap"); 
     mAttacher.setScale(4); 
     return true; 
    } 

但是圖像不希望規模

+0

你通過XML的ImageView的設置scaleType?這可能會改變setScale方法的行爲,我相信。 –

回答

0

發現解決方案

通過defauld MaximumScale是< 4,所以我補充一下:

mAttacher.setMaximumScale(5f);