Skip to content

Instantly share code, notes, and snippets.

@marc0x71
Created June 7, 2016 16:41
Show Gist options
  • Save marc0x71/6d13343a2d0f477879d7d0d777ee1d53 to your computer and use it in GitHub Desktop.
Save marc0x71/6d13343a2d0f477879d7d0d777ee1d53 to your computer and use it in GitHub Desktop.
VectorDrawable on pre-lollipop
<android.support.v7.widget.AppCompatImageView
android:layout_width="200dp"
android:layout_height="200dp"
android:id="@+id/imageView1"
android:src="@drawable/button"
/>
<ImageView
android:layout_width="200dp"
android:layout_height="200dp"
android:id="@+id/imageView2"
app:srcCompat="@drawable/button"
/>
android {
defaultConfig {
...
vectorDrawables.useSupportLibrary = true
...
}
}
public class MainActivity extends AppCompatActivity {
static {
AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment