
here on the screen above, I have two linear layouts, one for two TextViews and two EditText and another layout for Three Button, as shown in the figure,
Now I want to set these two layouts as shown below:
1) The first layout should be installed in the center of the screen
2) All buttons or a second layout should be installed at the bottom of the screen.
So, I want to ask how I can do this.
My xml file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:background="#000044">
<ScrollView android:id="@+id/scrollView1" android:layout_height="wrap_content" android:layout_width="match_parent">
<LinearLayout android:id="@+id/linearLayout1" android:layout_width="match_parent" android:orientation="vertical" android:layout_height="wrap_content" android:layout_gravity="center">
<TextView android:text="Login Phone" style="@style/TextStyle.Default" android:id="@+id/loginphone"></TextView>
<EditText android:layout_height="wrap_content" android:id="@+id/login" android:layout_width="match_parent" android:text="" android:inputType="number" android:numeric="integer" android:phoneNumber="true"></EditText>
<TextView android:text="Mobile Pin" android:id="@+id/mobilepin" style="@style/TextStyle.Default"></TextView>
<EditText android:layout_height="wrap_content" android:id="@+id/pin" android:inputType="number" android:numeric="integer" android:layout_width="match_parent" android:text="" android:password="true"></EditText>
</LinearLayout>
</ScrollView>
<LinearLayout android:id="@+id/linearLayout2" android:layout_height="match_parent" android:layout_gravity="bottom" android:layout_width="fill_parent" android:orientation="horizontal" android:gravity="bottom">
<Button android:id="@+id/preference" android:text="Preferences" android:layout_weight="1" android:layout_height="wrap_content" android:layout_width="fill_parent"></Button>
<Button android:id="@+id/loginbutton" android:text="Login" android:layout_weight="1" android:layout_height="wrap_content" android:layout_width="fill_parent"></Button>
<Button android:id="@+id/exit" android:text="Exit" android:layout_weight="1" android:layout_height="wrap_content" android:layout_width="fill_parent"></Button>
</LinearLayout>
</LinearLayout>
source
share