I am trying to learn about Animation and am using following layout
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_gravity="center"
android:padding="16dp">
<ImageButton
android:id="@+id/thumb_button_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:src="@mipmap/ic_launcher"
android:scaleType="centerCrop"
android:layout_gravity="center"
android:background="@null"
android:contentDescription="@string/description_image_1" />
</LinearLayout>
</FrameLayout>
However, this will not center the ImageButton vertically. It does it only horizontally. I tried layout_gravity "center", "center_vertical", "center_horizontal" without success. The best I got is this:
but I need to get this:
Much appreciated