Hi friends i have set my layout thru TabLayout within LinearLayout but still my button in the end couldn t be set properly as TabLayout divides all the fields in number of columns so can anyone help how to set 2 Layouts in one XML file means all the fields in TabLayout and remaining both Login and Register buttons in Linear Layout ore some other so that they can set properly.
提前谢谢。
Layout
Username ! EditTextBox
Password ! EditTextBox
Login ! Register
Button ! Button
我希望我的布局是上面的格式,所以我使用了TabLaout,但在这种情况下,它会导致我的按钮的视图,而且它会拉伸一个按钮而不是另一个按钮,因为EditText大于TextView
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:textSize="26sp"
android:text="@string/login_text"/>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TableRow>
<TextView
android:layout_width="120px"
android:text="User name"
/>
<EditText
android:id="@+id/txtUserName"
android:singleLine="true"
android:maxLength="20"
android:width="195px"
/>
</TableRow>
<TableRow>
<TextView
android:layout_width="120px"
android:text="Password"
/>
<EditText
android:id="@+id/txtPassword"
android:width="195px"
android:maxLength="20"
android:singleLine="true"
android:password="true"
/>
</TableRow>
<TableRow>
<TextView />
<CheckBox android:id="@+id/chkRememberPassword"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Remember Password"
/>
</TableRow>
<TableRow>
<Button
android:id="@+id/buttonRegister"
android:text="Register"
android:layout_width="124px"
android:layout_height="wrap_content"
android:layout_below="@+id/chkRememberPassword"
android:layout_alignRight="@+id/chkRememberPassword"
/>
<Button
android:id="@+id/buttonSignIn"
android:text="Log In"
android:layout_width="124px"
android:layout_height="wrap_content"
android:layout_below="@+id/chkRememberPassword"
android:layout_alignLeft="@+id/chkRememberPassword"
/>
</TableRow>
<TextView
android:id="@+id/statusError"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
</TableLayout>
</LinearLayout>