2
我遇到了这个大问题:当我点击edittext并且键盘向上时,键盘覆盖按钮。我在网上搜索了解决方案,但调整了resize,adjustpan不起作用。我也尝试使用getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
,但不起作用。Android-如何在键盘启动时自动滚动
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/sfondo3"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:isScrollContainer="true"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal" >
<TextView
android:id="@+id/nickname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="200dp"
android:text="Inserisci un Nickname:"
android:textSize="20dp" />
<Button
android:id="@+id/b1"
android:layout_width="120dp"
android:layout_height="50dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="350dp"
android:text="Accedi" />
<EditText
android:id="@+id/editText1"
android:layout_width="200dp"
android:layout_height="50dp"
android:layout_marginTop="250dp"
android:windowSoftInputMode="adjustPan"
android:layout_centerHorizontal="true"
android:ems="10" />
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="20dp"
android:src="@drawable/logox" />
</RelativeLayout>
</ScrollView>
刚刚尝试过,它不起作用... –