I don’t know why Username: and Password: is so far apart from the edittext forms. Can someone help me fix this?
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
<TableLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TableRow
android:layout_gravity="center"
android:gravity="center"
android:layout_marginTop="10dp"
>
<TextView
android:text="Username : "
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/userset"
style="@style/regFont"
/>
<EditText
android:id="@+id/versionuser"
android:layout_height="wrap_content"
android:layout_width="200dp"
android:layout_toRightOf="@id/userset">
<requestFocus>
</requestFocus>
</EditText>
</TableRow>
<TableRow
android:layout_gravity="center"
android:gravity="center"
android:layout_marginTop="5dp"
>
<TextView
android:text="Password : "
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/passset"
style="@style/regFont"
/>
<EditText
android:id="@+id/versionpass"
android:layout_height="wrap_content"
android:layout_width="200dp"
android:layout_marginTop="5dp"
android:layout_toRightOf="@id/passset"
android:inputType="textPassword">
</EditText>
</TableRow>
<TableRow
android:layout_gravity="center"
android:gravity="center"
android:layout_marginTop="5dp"
>
<CheckBox
android:text="Automatic Login"
android:id="@+id/cbauto"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</CheckBox>
</TableRow>
</TableLayout>
</RelativeLayout>
It’s because your CheckBox use the first row of your TableLayout. So your TextView will use the same size of your CheckBox.
You should try making a separate TableLayout for the CheckBox item so that it does not take the widths from the earlier TableRows, and then put both TableLayouts into an enclosing LinearLayout, like this: