Android 有没有办法在活动中固定标题,使其不随软键盘的输入而滚动?
我有一个活动,上面有一个标题,下面有一个编辑文本。当我发短信并按键盘上的enter键时,屏幕向下滚动并隐藏标题。有没有办法修复标题,或者在键盘上按enter键时,不向下滚动屏幕Android 有没有办法在活动中固定标题,使其不随软键盘的输入而滚动?,android,android-activity,android-edittext,android-softkeyboard,Android,Android Activity,Android Edittext,Android Softkeyboard,我有一个活动,上面有一个标题,下面有一个编辑文本。当我发短信并按键盘上的enter键时,屏幕向下滚动并隐藏标题。有没有办法修复标题,或者在键盘上按enter键时,不向下滚动屏幕 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" an
<LinearLayout 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:orientation="vertical"
tools:context=".ComentariosActivity" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="10"
android:background="@drawable/background_40_blue"
android:orientation="vertical" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="44dp"
android:background="@drawable/navigation_bar"
android:orientation="vertical" >
<ImageView
android:id="@+id/ivButtonOkComentarios"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginBottom="1dp"
android:layout_marginTop="2dp"
android:src="@drawable/mini_button_ok" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:text="4"
android:textColor="#FFCC66"
android:textSize="48sp" />
<TextView
android:id="@+id/tvRedeConfirmar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"
android:layout_marginTop="2dp"
android:text="Faça um comentário sobre a sua avaliação"
android:textColor="@android:color/white"
android:textSize="18sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="7"
android:orientation="vertical" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:src="@drawable/borda_tabela" />
<EditText
android:id="@+id/etComentarios"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:ems="10"
android:gravity="center_vertical|top"
android:maxLength="500"
>
<requestFocus />
</EditText>
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="3"
android:gravity="bottom" >
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="2"
android:orientation="vertical" >
<ImageView
android:id="@+id/ivRodapeComentarios"
android:layout_width="match_parent"
android:layout_height="56dp"
android:background="#00000000"
android:scaleType="fitXY"
android:src="@drawable/rodape_tappa" />
</LinearLayout>
在此处发布布局代码可能与清单中活动的安卓:WindowsOfInputMode=“adjustResize”参数有关,如果我理解正确,这里有很多选项-看看清单中是否有帮助安卓:WindowsOfInputMode=“stateaweysvisible”