I wonder how to move the linearLayout2
to the center of linearLayout1?
The imageView should be in the center
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:id="@+id/linearLayout1"
android:background="@android:color/transparent"
android:layout_marginTop="15dp"
android:layout_marginBottom="15dp"
android:layout_width="match_parent" xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:gravity="center_horizontal"
android:layout_height="wrap_content" xmlns:android="http://schemas.android.com/apk/res/android">
<ImageView
android:layout_gravity="center"
android:background="@drawable/circle"
android:layout_marginTop="75dp"
android:src="@mipmap/ic_launcher_round"
android:id="@+id/appsLogo"
android:layout_width="120dp"
android:layout_height="120dp"/>
<LinearLayout android:layout_width="250dp" android:layout_height="220dp"
android:id="@+id/linearLayout2"
android:layout_below="@+id/appsLogo"
android:background="@color/white"
android:orientation="vertical">
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center|bottom"
android:textColor="@color/colorPrimaryDark"
android:layout_marginTop="10dp"
android:textSize="25dp"
android:text="Choose an option"/>
<Button android:layout_width="150dp" android:layout_height="50dp"
android:layout_gravity="center"
android:layout_marginTop="20dp"
android:textColor="@color/white"
android:id="@+id/cameraBtn"
android:background="@color/lightseagreen"
android:text="Camera"/>
<Button android:layout_width="150dp" android:layout_height="50dp"
android:layout_marginTop="20dp"
android:layout_gravity="center"
android:textColor="@color/white"
android:id="@+id/galleryBtn"
android:background="@color/darkgrey"
android:text="Gallery"/>
</LinearLayout>
</LinearLayout>
Current Output
linearLayout2
should move up until reach the imageView
center.