Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

设置placeHolder和errorImage时,图加载不出来呢? #385

Open
lyj1005353553 opened this issue Dec 25, 2020 · 0 comments
Open

设置placeHolder和errorImage时,图加载不出来呢? #385

lyj1005353553 opened this issue Dec 25, 2020 · 0 comments

Comments

@lyj1005353553
Copy link

lyj1005353553 commented Dec 25, 2020

.placeHolder(new DrawableGetter() {
@OverRide
public Drawable getDrawable(ImageHolder holder, RichTextConfig config, TextView textView) {
Drawable drawable = ContextCompat.getDrawable(CommunityDetailActivity.this, R.drawable.community_img_error_selector);
int width = ScreenUtils.getScreenWidth(CommunityDetailActivity.this)
- SizeUtils.dp2px(CommunityDetailActivity.this, 20);
drawable.setBounds(0, 0, width, SizeUtils.dp2px(CommunityDetailActivity.this, 300));
return drawable;
}
}).errorImage(new DrawableGetter() {
@OverRide
public Drawable getDrawable(ImageHolder holder, RichTextConfig config, TextView textView) {
Drawable drawable = ContextCompat.getDrawable(CommunityDetailActivity.this, R.drawable.community_img_error_selector);
int width = ScreenUtils.getScreenWidth(CommunityDetailActivity.this)
- SizeUtils.dp2px(CommunityDetailActivity.this, 20);
drawable.setBounds(0, 0, width, SizeUtils.dp2px(CommunityDetailActivity.this, 300));
return drawable; //这样是可以显示出来,但又出来一个新问题,第二次进入的时候,占位不显示图,非得重新加载一遍,加了 .autoFix(false)就可以解决这个问题了,但另一个问题来了,成功加载正确地址图片大小被改变了
}
})

还显示错误com.zzhoujay.richtext.exceptions.ImageWrapperMultiSourceException: GifDrawable和Bitmap有且只有一个为null

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant