Reputation: 5667
I've tried several things but my image always appears as a proportionally scaled down version of itself. I want it to take up the full width available to it and for it to bleed over the image boundaries height-wise.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/messageImageLayout"
android:layout_width="match_parent"
android:layout_height="150dp"
android:gravity="center_horizontal|center_vertical">
<ImageView
android:id="@+id/messageImage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleType="fitXY"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="5dp"
android:layout_marginTop="10dp"
android:adjustViewBounds="true"
android:src="@drawable/test"
android:visibility="gone" />
</LinearLayout>
How it looks now:
What I want:
Upvotes: 1
Views: 35
Reputation: 544
Replace android:scaleType="fitXY"
with android:scaleType="centerCrop"
instead
Upvotes: 2