The Problem
I have an ImageView in my XML like that:
<ImageView
android:layout_width="100dp"
android:layout_height="100dp"
android:src="@drawable/ic_person_add"
android:alpha="0.87" />
The ic_person_add
is the normal Material design Vectoricon.
On my Nexus 5 (Android 6), the icon scales beautiful and is really sharp:
On a Note 2 (Android 4.4) however, the icon gets really pixelated and ugly:
How do I get the ImageView (with a Vector as src) sharp on every device? Preferably with an only xml solution.
I already found:
- Adding
android:adjustViewBounds="true"
-> did nothing - ImageView images seem pixelated and low quality -> Doesn't apply to vector
- Setting
BitmapFactory.inscaled=false
-> doesn't work with only xml and I didn't know where to put this in a custom ImageView class.