Created
June 7, 2016 16:41
-
-
Save marc0x71/6d13343a2d0f477879d7d0d777ee1d53 to your computer and use it in GitHub Desktop.
VectorDrawable on pre-lollipop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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" | |
/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
android { | |
defaultConfig { | |
... | |
vectorDrawables.useSupportLibrary = true | |
... | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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