Reputation: 47
I have imageview with resolution of 430x871 in folders xxhdpi, xhdpi and hdpi. But when I run app, on 5" Xperia Z (xxhdpi) screen it works normally (1. picture) but on 4.7" Amazon Phone (xhdpi) it's smaller (2. picture). Altough when I run it on Amazon Fire HD 8.9 or 7 or 6, (all xdpi) it works too...
How can I stretch in on that Amazon Phone?
Here is XML code of the Imageview:
<ImageView
android:id="@+id/matter"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:gravity="center"
android:src="@drawable/matter"
/>
Upvotes: 0
Views: 56
Reputation: 9477
if aspect ratio is not important for you use:
android:scaleType="fitXY"
but if yes try this:
android:scaleType="fitCenter"
and also change this:
android:layout_height="match_parent"
Upvotes: 1
Reputation: 6104
There's a property called :
android:scaleType="fitXY"
inside ImageView tag.
Upvotes: 0