0

Is there any way to use xml layout into fresco library instead of hierarchy image? I used layout like below :

simpledraweeview.getHierarchy().setPlaceholderImage(layout.id);

but it didn't work.

this error hapend :

.Resources$NotFoundException: File res/layout/hierarchy_layout.xml from drawable resource ID #0x7f040049

Morteza
  • 59
  • 2
  • 10

2 Answers2

0

It means the resource what you are trying to apply is not available. My Suggestion is you can try Picasso library.

Picasso.with(context)
.load(url)
.placeholder(R.drawable.user_placeholder)
.error(R.drawable.user_placeholder_error)
.into(imageView);

or you can try Glide library.

Glide.with(myFragment)
    .load(url)
    .centerCrop()
    .placeholder(R.drawable.loading_spinner)
    .crossFade()
    .into(myImageView);
Sridhar
  • 668
  • 1
  • 11
  • 22
0

Fresco supports setting your placeholder in XML: http://frescolib.org/docs/using-drawees-xml.html#_

tyronen
  • 2,558
  • 1
  • 11
  • 15