Android 在SimpleImage视图SetPlaceholder图像中使用xml文件

Android 在SimpleImage视图SetPlaceholder图像中使用xml文件,android,xml,fresco,Android,Xml,Fresco,有没有办法使用xml布局到fresco库中,而不是层次图像? 我使用了如下布局: SimpleDraweView.getHierarchy().SetPlaceholder图像(layout.id) 但它不起作用 此错误可能会导致: .Resources$NotFoundException:drawable resource ID#0x7f040049中的文件res/layout/hierarchy_layout.xml表示您尝试应用的资源不可用。我的建议是你可以试试 或 你可以试试 Fresc

有没有办法使用xml布局到fresco库中,而不是层次图像? 我使用了如下布局:

SimpleDraweView.getHierarchy().SetPlaceholder图像(layout.id)

但它不起作用

此错误可能会导致:


.Resources$NotFoundException:drawable resource ID#0x7f040049中的文件res/layout/hierarchy_layout.xml表示您尝试应用的资源不可用。我的建议是你可以试试

或 你可以试试


Fresco支持在XML中设置占位符:

Picasso.with(context)
.load(url)
.placeholder(R.drawable.user_placeholder)
.error(R.drawable.user_placeholder_error)
.into(imageView);
Glide.with(myFragment)
    .load(url)
    .centerCrop()
    .placeholder(R.drawable.loading_spinner)
    .crossFade()
    .into(myImageView);