У меня возникает проблема при открытии клавиатуры, текст редактирования отображается частично, например, не полный.android edittext становится видимым на открытой клавиатуре
Скриншот:
Вот код макета:
<ScrollView 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:background="@color/lightgreen"
android:fillViewport="true"
android:padding="20dp" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/lightgreen"
android:orientation="vertical" >
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/str_mobilenumber"
android:textSize="16sp" />
<EditText
android:id="@+id/reg_mobile"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="phone" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/str_password"
android:textSize="16sp" />
<EditText
android:id="@+id/reg_password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPassword" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/str_password_confirm"
android:textSize="16sp" />
<EditText
android:id="@+id/reg_password_confirm"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPassword" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/str_fullname"
android:textSize="16sp" />
<EditText
android:id="@+id/reg_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:ignore="TextFields" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/str_email"
android:textSize="16sp" />
<EditText
android:id="@+id/reg_email"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textEmailAddress" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="3dp"
android:text="@string/str_city"
android:textSize="16sp" />
<Spinner
android:id="@+id/reg_city"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:entries="@array/cities_array"
android:prompt="@string/str_city" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/str_zip"
android:textSize="16sp" />
<EditText
android:id="@+id/reg_zip"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:inputType="phone" />
<Button
android:id="@+id/btnRegister"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="actionRegister"
android:text="@string/str_register" />
</LinearLayout>
</ScrollView>
Такая же проблема происходит с любым текстовым полем редактирования, что, когда клавиатура oens, он не полностью появится. Есть ли способ избежать этой проблемы?
Благодаря
Вы использовали ScrollView, чтобы даже при открытии клавиатуры вы могли прокручивать вниз и видеть edittext и другие виды, которые не видны – Jamil