question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PlaceholderImageScaleType sometimes doesn't work

See original GitHub issue

PlaceholderImageScaleType doesn’t work

  • When I use the attribute of the roundedcorner, placeholderImageScaleType not normal work, like I set, on the system version for Android P’s phone

  • Fresco version:com.facebook.fresco:fresco:2.1.0

 <com.facebook.drawee.view.SimpleDraweeView
        android:id="@+id/draweePoiIcon"
        android:layout_width="70dp"
        android:layout_height="50dp"
        android:layout_marginStart="12dp"
        android:layout_marginTop="12dp"
        android:scaleType="fitCenter"
        app:actualImageScaleType="fitCenter"
        app:placeholderImage="@drawable/poi_detail_image_place_holder"
        app:placeholderImageScaleType="fitCenter"
        app:roundedCornerRadius="5dp" />

  • The actual rendering shown:
rendering
  • The source file used: original_image

  • I hope to get your help. Thank you very much

@oprisnik

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
QXH313commented, May 27, 2020

I’ve solved this problem by moving the image resource into the drawable-nodpi file @lynn-kollectin @oprisnik

1reaction
lynn-kollectincommented, May 27, 2020

Thanks @oprisnik. If I set placeholder image programmatically, and I remove fresco:placeholderImage from xml, it works ok no matter using Drawable or resource ID. If I didn’t remove fresco:placeholderImage from xml, it still displayed abnormally. (My those PNG files are in drawable-nodpi)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Allow a different scale type for placeholder images · Issue #368
We want to have a placeholder image that looks a bit like a 'picture frame' icon - similar to what facebook does in...
Read more >
Glide: load drawable but don't scale placeholder
I have an ImageView with variable size (depending on the incoming image) which I set before calling Glide.with().load().into() and I want to use ......
Read more >
ScaleTypes - Fresco
ScaleTypes of actual, placeholder, retry, and failure images can all be set in XML, using attributes like fresco:actualImageScaleType .
Read more >
The Complete Guide to Lazy Loading Images | CSS-Tricks
Wondering how lazy loading images works? ... down the image to down to a 1×1 pixel and then scale it up to the...
Read more >
Picture perfect images with the modern <img> element
We can combine background-image with background-size: cover to set the size of an element's background image and scale the image as large as ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found