hello , I set the simpledraweeView scaletype as centerCrop , but it can't effect.
thank you for help!
my code:
xml:
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"
fresco:actualImageScaleType="centerCrop"
/>
java:
mImage = (SimpleDraweeView) itemView.findViewById(R.id.iv_image);
mImage.setAspectRatio(1.5f);
the result picture (the left pic is fail):
Don't use android:scaleType
.
However, it's not clear to me from your image what the problem is - the left image looks like it has indeed be center-cropped. Can you give us examples of what you are trying to see and what you are actually seeing?
I hope you are loading image from network. Do scaling programmatically holder.image.setScaleType(ImageView.ScaleType.CENTER_CROP);
simpleDraweeView.getHierarchy().setActualImageScaleType(ScalingUtils.ScaleType.CENTER_CROP);
Most helpful comment
simpleDraweeView.getHierarchy().setActualImageScaleType(ScalingUtils.ScaleType.CENTER_CROP);