I'm trying to align an image to it's parents bottom. The basic idea is to fit the image to screen width, use wrap_content
for height and then align all that to the parent's bottom. Unfortunately the result is a 1-2dp margin at the bottom I cannot get rid of. I changed the parent's background here to blue so it is obvious:
<RelativeLayout
android:layout_gravity="center_horizontal"
android:id="@+id/contentView"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@drawable/top_graphic" />
//...
</RelativeLayout>
This is how it looks like in layout builder:
That blue line at the bottom I cannot get rid of. I don't want to use direct dp
values obviously, how can I solve this?