Android阻止键盘将视图推离屏幕
嗨,我有一个编辑文本和一个按钮,我想在屏幕的底部和一个滚动视图的位置和顶部的图像视图 当键盘弹出时,它会覆盖编辑文本。我目前的手册中有这一套Android阻止键盘将视图推离屏幕,android,Android,嗨,我有一个编辑文本和一个按钮,我想在屏幕的底部和一个滚动视图的位置和顶部的图像视图 当键盘弹出时,它会覆盖编辑文本。我目前的手册中有这一套 android:windowSoftInputMode="adjustPan|adjustResize" 如果我使用 android:windowSoftInputMode="adjustPan" or android:windowSoftInputMode="adjustResize" 我的编辑文本和按钮随键盘移动,并位于键盘顶部,这正是我想要的。但
android:windowSoftInputMode="adjustPan|adjustResize"
如果我使用
android:windowSoftInputMode="adjustPan" or android:windowSoftInputMode="adjustResize"
我的编辑文本和按钮随键盘移动,并位于键盘顶部,这正是我想要的。但是ScrollView被推离屏幕
有没有办法让编辑文本和按钮随键盘移动
这是我的布局
<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:id="@+id/levelView"
>
<ScrollView
android:id="@+id/scroll"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:isScrollContainer="false"
android:layout_alignParentTop="true">
<ImageView
android:id="@+id/kit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginTop="5dp"
android:src="@drawable/106"
android:adjustViewBounds="true" />
</ScrollView>
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="51dp"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:padding="10dp"
android:textColor="@color/white"
android:text="Get help"
android:background="@color/green_pressed"
android:gravity="bottom" />
<EditText
android:id="@+id/editText1"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:layout_alignBaseline="@+id/button1"
android:layout_alignBottom="@+id/button1"
android:layout_alignParentRight="true"
android:layout_toRightOf="@+id/button1"
android:hint="Answer"
android:inputType="text"
android:imeOptions="actionGo"
android:background="@color/white"
android:padding="11dp"
android:gravity="bottom"
>
</EditText>
</RelativeLayout>
ScrollView sv = (ScrollView)findViewById(R.id.scroll);
sv.setEnabled(false);