Я просто хочу знать, сталкивались ли вы уже с этой проблемой в тексте редактирования, когда вы устанавливаете гравитацию в «центр», когда клавиатура перекрывает текст редактирования. Надеюсь, вы поможете мне решить эту проблему.
Я добавил свой код ниже.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/img_splash"
android:gravity="bottom"
android:orientation="vertical"
android:paddingLeft="20dp"
android:paddingRight="20dp" >
<ScrollView
android:id="@+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<EditText
android:id="@+id/edit_username"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:layout_marginBottom="13dp"
android:background="@drawable/img_textfield"
android:ems="10"
android:gravity="center_vertical|center_horizontal"
android:hint="Username"
android:imeOptions="actionNext"
android:maxLines="1"
android:singleLine="true"
android:textSize="18sp" />
<EditText
android:id="@+id/edit_password"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:layout_marginBottom="28dp"
android:background="@drawable/img_textfield"
android:ems="10"
android:gravity="center_vertical|center_horizontal"
android:hint="Password"
android:inputType="textPassword"
android:maxLines="1"
android:singleLine="true"
android:textSize="18sp" />
</LinearLayout>
</ScrollView>
<Button
android:id="@+id/button_login"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:layout_marginBottom="75dp"
android:background="@drawable/btn_login"
android:onClick="onClicked"
android:text="Login"
android:textColor="@color/white_pure"
android:textSize="18sp" />
</LinearLayout>
android:windowSoftInputMode="adjustResize|adjustPan"
в свою деятельность в файлеmanifest.xml
. - person M D   schedule 12.02.2014adjustPan
иadjustResize
- person M D   schedule 12.02.2014EditText
вScrollView
и попробуйте также загрузить свой макет - person M D   schedule 12.02.2014