【问题标题】:How to override doubletap of PhotoView如何覆盖 PhotoView 的双击
【发布时间】:2015-01-14 13:15:08
【问题描述】:

我想在双击后设置 scale=4

在 onCreate() 中:

         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;
    }

但图片不想缩放

【问题讨论】:

  • 你是否在 ImageView 上通过 XML 设置了 scaleType?我相信这可能会改变 setScale 方法的行为。

标签: android double tap photoviewer


【解决方案1】:

找到解决办法

默认MaximumScale

mAttacher.setMaximumScale(5f);

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-04-25
    • 2010-11-16
    • 1970-01-01
    • 2015-08-15
    • 1970-01-01
    相关资源
    最近更新 更多