将 Scale fitXY 属性用于 Zoomable imageview 是否可行?

时间:2021-01-22 13:51:11

标签: java android image touch

我有一个自定义的图像视图类,用于捏合缩放图像,并为此尝试了许多库,但它的用途

setScaleType(ScaleType.MATRIX);

默认情况下,如果我从类中删除此行,则缩放功能不起作用



  public ZoomableImageView(Context context, AttributeSet attr) {
        super(context, attr);
        super.setClickable(true);
        this.context = context;
        mScaleDetector = new ScaleGestureDetector(context, new ScaleListener());
        matrix.setTranslate(1f, 1f);
        m = new float[9];
        setImageMatrix(matrix);
        setScaleType(ScaleType.MATRIX);
}

我想在这个类上应用 fitXY 比例类型以适应 imageview 上的图像,但它不起作用

我需要带有可缩放图像视图的 fitXY 属性,那么我该怎么做?

0 个答案:

没有答案
相关问题