It's wonderful that pre-lollipop devices now can use VectorDrawables by using Support library 23.2.0. Though I have image display issue on API 21+, but everything works fine on lower devices. I'm using Gradle Plugin 1.5, so my build.gradle contains this:
// Gradle Plugin 1.5
android {
defaultConfig {
generatedDensities = []
}
// This is handled for you by the 2.0+ Gradle Plugin
aaptOptions {
additionalParameters "--no-version-vectors"
}
}
Then I use next code in my layout:
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:srcCompat="@drawable/my_vector_drawable" />
I have declared in my parent's ViewGroup this attribute:
xmlns:app="http://schemas.android.com/apk/res-auto"
But still Android Studio shows this error, but project can build and run
"Unexpected namespace prefix "app" found for tag ImageView"
And this what I get as a result on Android 4.3:
Is it a bug of the new support library or am I doing something wrong?
to solve your image scaling issue, have you tried setting scaleType='fitXY'
to your ImageView?
(You can safely ignore that Lint error for now also adding tools:ignore="MissingPrefix"
to your ImageView).