This question may be similar to this and this, but they didn't solve my problem. I have a login UI, which looks like this:
When I click the Username field, it becomes like this:
As you can see here, the Password field is covered by the soft keyboard, and after input the Username, you have to first close the soft keyboard and then click the Password field to type in the password, which is not user friendly. How to avoid the Password field being covered by the soft keyboard so that the user can type in the password directly. Below is the layout of this UI.
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="eda397.group10.navigator.MainActivity$PlaceholderFragment" >
<ImageView
android:id="@+id/logo"
android:layout_width="125dp"
android:layout_height="125dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_marginTop="24dp"
android:src="@drawable/ic_launcher" />
<Button
android:id="@+id/register_button"
android:layout_width="85dp"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignRight="@+id/login_username"
android:layout_marginBottom="65dp"
style="@style/CustomStyleButton"
android:text="@string/button_register" />
<EditText
android:id="@+id/login_username"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_alignLeft="@+id/login_password"
android:layout_alignRight="@+id/login_password"
android:layout_centerVertical="true"
android:background="#d8d8d8"
android:ems="10"
android:hint="@string/username_message" >
</EditText>
<EditText
android:id="@+id/login_password"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_below="@+id/login_username"
android:layout_centerHorizontal="true"
android:layout_marginTop="17dp"
android:background="#d8d8d8"
android:ems="10"
android:hint="@string/password_message"
android:inputType="textPassword" />
<Button
android:id="@+id/login_button"
android:layout_width="85dp"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/register_button"
android:layout_alignBottom="@+id/register_button"
android:layout_alignLeft="@+id/login_username"
style="@style/CustomStyleButton"
android:text="@string/button_send" />
</RelativeLayout>