我正在创建一个获取一些值的应用程序,你点击一个按钮,它会返回一些其他值,这个视图分布在一个更大的垂直LinearLayout的2个subLayouts中,如下所示:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="10dp">
<RelativeLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
android:layout_weight="0.4">
<EditText
android:layout_width="70dp"
android:layout_height="wrap_content"
android:inputType="number"
android:id="@+id/number1" />
<EditText
android:layout_width="70dp"
android:layout_height="wrap_content"
android:inputType="number"
android:id="@+id/number2"
android:layout_below="@+id/number1" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Calc!"
android:id="@+id/calcButton"
android:layout_below="@+id/number2"/>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
android:layout_weight="0.6"
android:layout_alignParentBottom="true">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Answer"
android:id="@+id/Answer" />
</RelativeLayout>
</LinearLayout>我的问题是,当我点击我的EditText时,键盘出现了答案的TextView与键盘一起弹出,并“覆盖”我的按钮(整个RelativeLayout跟随键盘),有一种方法设置RelativeLayout固定,使它停留在它的意思是在哪里?下面是正在发生的事情:

有办法修复那个RelativeLayout吗?
https://stackoverflow.com/questions/38083419
复制相似问题