0xOsiris
0xOsiris

Reputation: 277

Align the center of an image to the bottom of the screen

I was wondering what would be the easiest way to align the vertical center of an image to the bottom of the screen in android. It doesn't seem like it should be that hard, but I can't seem to find anything with an answer to this.

Upvotes: 0

Views: 54

Answers (1)

PaulyC
PaulyC

Reputation: 139

You could use a FrameLayout and position the ImageView at the Bottom center of it.

<FrameLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_gravity="center_horizontal">

    <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/imageView"
            android:layout_gravity="center_horizontal|bottom" />
</FrameLayout>

Upvotes: 1

Related Questions