Skip to content

ImageView

NeverGivinUp edited this page Sep 24, 2015 · 3 revisions

ImageView can render Bitmaps as well as SVGs. To use SVGs with ImageView put them in the raw folder and set their resource id with ImageView#setImageResource(int). ImageView will interpret resource as an SVG. It will consider height and width of the SVG as dip values.

Complex SVGs might load very(!) slow. Make certain to load them in a separate thread (either preload or load after displaying a place holder).

ImageView by default animates visibility changes. To change visibility immediately -- e.g. when using ImageView in a RecyclerView -- change animation to Style.None or call setVisibilityImmediate().