fresco icon indicating copy to clipboard operation
fresco copied to clipboard

Use fresco:actualImageScaleType="fitCenter" will

Open nimengbo opened this issue 11 years ago • 1 comments

I create a class extends SimpleDraweeView as SquareSimpleDraweeView and override this method:

@Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, widthMeasureSpec); } use it in listview. and use it in xml : android:id="@+id/iv_pic" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/white" fresco:actualImageScaleType="fitCenter" fresco:placeholderImage="@drawable/icon_default_pic" fresco:roundBottomLeft="true" fresco:roundBottomRight="true" fresco:roundTopLeft="true" fresco:roundTopRight="true" fresco:roundedCornerRadius="1px" fresco:roundingBorderColor="@color/grey_cccccc" fresco:roundingBorderWidth="1px"

display as :

image

It is a bug?

original picture is

image

nimengbo avatar Aug 19 '15 02:08 nimengbo

No need to extend SimpleDraweeView to make it square, simply add the following XML properties: fresco:viewAspectRatio="1" and android:layout_height="wrap_content". As for the repeated edges, this is a known limitation of Android. Please see the Caveats section of Rounded Corners and Circles.

plamenko avatar Aug 19 '15 11:08 plamenko