Android 安卓:像instagram一样,使用毕加索将图像调整为全宽和全高
在Android 安卓:像instagram一样,使用毕加索将图像调整为全宽和全高,android,image,bitmap,imageview,Android,Image,Bitmap,Imageview,在RecyclerView中,图像显示为全高和全宽,并且不显示为拉伸,这可能吗?将其添加到您的图像视图中 android:adjustViewBounds="true" android:scaleType="centerCrop" 试试这段代码 Picasso.with(myContext).load(uri).resize(720, 720) .centerCrop().into(aImageView); 我认为它对你的情况有效。只使用androi
RecyclerView
中,图像显示为全高和全宽,并且不显示为拉伸,这可能吗?将其添加到您的图像视图中
android:adjustViewBounds="true"
android:scaleType="centerCrop"
试试这段代码
Picasso.with(myContext).load(uri).resize(720, 720)
.centerCrop().into(aImageView);
我认为它对你的情况有效。只使用android:scaleType=“fitXY”使用
android:scaleType=“centerInside”
ImageView.ScaleType中心\内部
均匀缩放图像(保持图像的纵横比),使图像的两个尺寸(宽度和高度)等于或小于视图的相应尺寸(减去填充)
“居中内部”属性不会更改图像纵横比。如果您为ImageView
提供高度和宽度,则会根据位图纵横比调整其图像大小,从而确保显示完整图像
Picasso.with(myContext).load(uri).resize(720, 720)
.centerCrop().into(aImageView);
<ImageView
android:id="@+id/imageView"
android:layout_width="fixed_width_for_each_cell"
android:layout_height="fixed_height_for_each_cell"
android:scaleType="centerInside"
/>