, , , srcCompat.
, , , drawable-21, Drawable , Drawables. , , - . Drawable.
, ImageView AppCompatImageView. , , , .
- , , , . - , , , leftImage ImageButton. 23.3, @Zeke. , 23.4, ,
static {
AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);
}
, . . https://medium.com/@chrisbanes/appcompat-v23-2-age-of-the-vectors-91cbafa87c88#.s48hqaw1u, .
Drawable . - ;
Drawable icon = AppCompatDrawableManager.get().getDrawable(context, resVectorID);
// Set it for example as a left image of button
button.setCompoundDrawablesWithIntrinsicBounds( icon, null, null, null );
I have not tested this and have no idea if this causes memory problems or not. Will it be loved if someone can follow him.
source
share