When using Fresco, you will use SimpleDraweeView to display images. These can be used in XML layouts. The simplest usage example of SimpleDraweeView is:

NOTE: SimpleDraweeView does not support wrap_content for layout_width or layout_height attributes. More information can be found here. The only exception to this is when you are setting an aspect ratio, like so:

Loading an image

The easiest way to load an image into a SimpleDraweeView is to call setImageURI:

That’s it, you are now displaying images with Fresco!

Advanced XML attributes

SimpleDraweeView, despite its name, supports a great deal of customization through XML attributes. The example below presents all of them:

Customizing from code

Although it’s generally recommended to set these options in XML, all of the attributes above can also be set from code. In order to do this, you will need to create a DraweeHierarchy before setting the image URI:

NOTE: some of these options can be set on an existing hierarchy without having to build a new one. To do this, simply get the hierarchy from a SimpleDraweeView and call any of the setter methods on it, e.g.: