After using the roundedCornerRadius property, setFailureImage ScaleType does not work properly
See original GitHub issueDescription
After using the roundedCornerRadius property, setFailureImage ScaleType does not work properly
Reproduction
- xml
<com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/pic_image"
android:layout_width="match_parent"
android:layout_height="wrap_content"
fresco:viewAspectRatio="1.77"
fresco:roundedCornerRadius="@dimen/spa_3"/>
- code
/**
* 设置通用样式
*
* @param view SimpleDraweeView
* @param load_drawable 加载动画
* @param place_holder 默认图
*/
private static void initImageHierarchy(SimpleDraweeView view, Drawable load_drawable, int place_holder) {
GenericDraweeHierarchy hierarchy = view.getHierarchy();
hierarchy.setFadeDuration(500);
hierarchy.setProgressBarImage(load_drawable);
hierarchy.setFailureImage(R.mipmap.place_holder, ScalingUtils.ScaleType.CENTER_INSIDE);
if (place_holder != 0) {
hierarchy.setPlaceholderImage(place_holder, ScalingUtils.ScaleType.CENTER_INSIDE);
}
hierarchy.setActualImageScaleType(ScalingUtils.ScaleType.FIT_XY);
}
Solution
- fresco:roundedCornerRadius=“@dimen/spa_3” After use, there will be no centering setFailureImage
- ScalingUtils.ScaleType.CENTER_INSIDE It seems to lose the benchmark
Additional Information
- Fresco version: [1.13.0]
- Platform version: [Android 9]
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
ImageView ScaleType is Not Working - why? - Stack Overflow
ImageViews showing pictures off course but every image has different aspect ratio. Then i want to use ImageView scaleType property for image's ...
Read more >Using SimpleDraweeView - Fresco
When using Fresco, you will use SimpleDraweeView to display images. These can be used in XML layouts. The simplest usage example of SimpleDraweeView...
Read more >ImageView.ScaleType - Android Developers
Scale using the image matrix when drawing. The image matrix can be set using ImageView#setImageMatrix(Matrix) . From XML, use this syntax: ...
Read more >Android Fresco图片处理库用法API英文原文文档2-1 ...
This is a property of the controller, not the hierarchy. It therefore is not set by any of the methods used by the...
Read more >Working with the ImageView | CodePath Android Cliffnotes
In the example, using scaleType "center", the image will be displayed at its ... the image and still adjust the image according to...
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
Please set a failure image scale type. That should fix your issues.
unsolved