Placehoder image not centered on Android P
See original GitHub issueDescription
The placeholder image is not centred on Android P (OK on other versions of Android):
Reproduction
When using the image below as placeholder image in SimpleDraweeView, placing it to drawable-xhdpi
folder and with param roundAsCircle=true
Example XML
<com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/profile_avatar"
android:layout_width="@dimen/profile_me_avatar"
android:layout_height="@dimen/profile_me_avatar"
android:layout_centerHorizontal="true"
android:padding="@dimen/16dp"
app:failureImage="@drawable/edit_profile_default_avatar"
app:placeholderImage="@drawable/edit_profile_default_avatar"
app:failureImageScaleType="fitCenter"
app:actualImageScaleType="fitCenter"
app:placeholderImageScaleType="fitCenter"
app:roundAsCircle="true"
/>
Additional Information
- Fresco version: 1.11.0
- Platform version: Android Pie, Nokia 7 Plus
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:11 (1 by maintainers)
Top Results From Across the Web
fixed placeholder in the center of image view - Stack Overflow
I want my image to fitXY and placeholder in the center but of smaller size, as you can see in above image ·...
Read more >Image is not centered with .fitCenter() #1444 - bumptech/glide
The placeholder and the image probably have different aspects (#363). Try to use a placeholder that matches that squarish aspect.
Read more >Lazy Loading Images – The Complete Guide - ImageKit.io
Lazy loading images that are not in the viewport improves initial page ... As the user scrolls down the page, the image placeholders...
Read more >Displaying Images with the Picasso Library
Open up your static placeholder or error images in your drawable folders and make sure that the dimensions of the images are relatively...
Read more >object-position - CSS: Cascading Style Sheets - MDN Web Docs
The object-position CSS property specifies the alignment of the selected replaced element's contents within the element's box.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m still having this issue even after putting the file to /res/drawable
EDIT: Fixed it after moving the resource to /res/drawable-nodpi (tested on Pixel 2 XL - Android Q)
I verified that this works properly for P if you put the placeholder in
res/drawable/
. I guess Android P changed the way that drawables are loaded if variants are missing.