fresco icon indicating copy to clipboard operation
fresco copied to clipboard

PlaceholderImage don't display in AndroidStudio preview if has rounded attribute.

Open MarkMjw opened this issue 11 years ago • 12 comments

my code: <com.facebook.drawee.view.SimpleDraweeView android:id="@+id/card_advertise_icon" android:layout_width="85dp" android:layout_height="65dp" fresco:actualImageScaleType="centerCrop" fresco:placeholderImage="@drawable/search_default" fresco:placeholderImageScaleType="centerInside" fresco:roundedCornerRadius="2dp" />

MarkMjw avatar Jun 04 '15 05:06 MarkMjw

Is this only the case in AndroidStudio preview? Also, does the image show if you don't specify roundedCornerRadius?

plamenko avatar Jun 04 '15 11:06 plamenko

Yes, it's only in AndroidStudio layout xml preview. my layout: 1

the preview screen: 2

MarkMjw avatar Jun 04 '15 15:06 MarkMjw

set roundAsCircle=true is same as this.

MarkMjw avatar Jun 04 '15 15:06 MarkMjw

I have tried it without roundedCornerRadius and set roundAsCircle=true, and it does not let me see the preview either. And worse, it doesn't let me preview any other part of the screen when I have the placeholder image.

    <com.facebook.drawee.view.SimpleDraweeView
        android:layout_width="70dp"
        android:layout_height="70dp"
        android:id="@+id/imageView5"
        fresco:roundAsCircle="true"
        fresco:roundingBorderColor="@color/yellow"
        fresco:roundingBorderWidth="2dp"
        fresco:placeholderImageScaleType="fitCenter"
        fresco:placeholderImage="@drawable/userimage"
        android:layout_gravity="center" />

FragShawn avatar Jul 20 '15 18:07 FragShawn

preview does not works but if you apply some background image using android:background="@drawable/sample_img_1" then it gives a preview of your
fresco:placeholderImage="@drawable/sample_img_1" or give your image a static width or height not wrap_content,match_parent etc. its not a permanent solution but can work till some bug fix comes from developer side. thanks

worstkiller avatar Apr 03 '16 07:04 worstkiller

Android studio use another xml reference for fresco: Use this:

xmlns:fresco="http://schemas.android.com/apk/res-auto"

iosifnicolae2 avatar Feb 18 '17 11:02 iosifnicolae2

@iosifnicolae2 adding the reference causes no visible change. As of posting this comment, the issue still exists.

dorkmania avatar Feb 08 '18 08:02 dorkmania

Any word on this?

scottkruse avatar May 29 '18 05:05 scottkruse

Hey @scottkruse :)

This is indeed a long-standing bug. While it's annoying, there have been more critical issues that we've focused on in the mean time.

There's a good chance that the necessary code change is quite easy. That is why we've marked it as a "starter-task" and "help-wanted" to welcome external contributors and pull-requests.

lambdapioneer avatar May 30 '18 14:05 lambdapioneer

same issue

EduardoDornel avatar Sep 05 '18 17:09 EduardoDornel

I put the workaround on this issue to temporary disable the rounded feature on preview, so we can at least show the preview. Until Android Studio address the issue.

You can try the library on master branch or wait for the next version tagging.

zinuzoid avatar Sep 05 '18 22:09 zinuzoid

This has been fixed. Screenshot 2020-04-03 at 16 01 51

Android Studio 3.6.1 Fresco 2.1.0

tomislavhofman avatar Apr 03 '20 14:04 tomislavhofman