设置毕加索图像的最大宽度和最大高度。它在Android Studio中不起作用

时间:2017-04-03 03:14:19

标签: java android xml picasso

我试图设置毕加索图像的设置最大宽度和最大高度,但由于某种原因它无法正常工作。

这是我的代码:
Picasso.with(this).load(imagePath).transform(new CircleTransform()).into(imageTest);

这是我的xml:

 <ImageView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:adjustViewBounds="true"
    android:maxWidth="42dp"
    android:maxHeight="42dp"
    android:scaleType="fitCenter"
    android:id="@+id/imageTest"/>

1 个答案:

答案 0 :(得分:1)

使用调整大小

Picasso.with(this).load(imagePath).resize(42,42).transform(new CircleTransform().into(imageTest);