首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在安卓中修复"subLayout“

如何在安卓中修复"subLayout“
EN

Stack Overflow用户
提问于 2016-06-29 02:11:42
回答 0查看 85关注 0票数 0

我正在创建一个获取一些值的应用程序,你点击一个按钮,它会返回一些其他值,这个视图分布在一个更大的垂直LinearLayout的2个subLayouts中,如下所示:

代码语言:javascript
复制
<?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吗?

EN

回答

页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/38083419

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档