Fresco: 对 set scaletype 没有影响:centerCrop

创建于 2015-09-22  ·  3评论  ·  资料来源: facebook/fresco

你好,我把 simpledraweeView 的 scaletype 设置为 centerCrop ,但是没有效果。

谢谢你的帮助!

我的代码:

xml:
android:id="@+id/iv_image"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_10"
android:scaleType="centerCrop"
壁画:actualImageScaleType="centerCrop"
/>

爪哇:
mImage = (SimpleDraweeView) itemView.findViewById(R.id.iv_image);
mImage.setAspectRatio(1.5f);

结果图(左图失败):
image

needs-details

最有用的评论

simpleDraweeView.getHierarchy().setActualImageScaleType(ScalingUtils.ScaleType.CENTER_CROP);

所有3条评论

不要使用android:scaleType

但是,从您的图像中我不清楚问题是什么 - 左侧图像看起来确实被居中裁剪了。 您能否举例说明您想看到的和实际看到的?

我希望你从网络加载图像。 以编程方式进行缩放 holder.image.setScaleType(ImageView.ScaleType.CENTER_CROP);

simpleDraweeView.getHierarchy().setActualImageScaleType(ScalingUtils.ScaleType.CENTER_CROP);

此页面是否有帮助?
0 / 5 - 0 等级

相关问题

zewenwang picture zewenwang  ·  4评论

rhettor picture rhettor  ·  3评论

sungerk picture sungerk  ·  3评论

hanhmh1203 picture hanhmh1203  ·  4评论

satyarths picture satyarths  ·  3评论