0

How to I show the relative layout in the red area when soft input opened? I tried adjustPan and adjustResize input modes but did not happen. Any ideas?

enter image description here


enter image description here

4

1 回答 1

0

首先,android:windowSoftInputMode="adjustResize"在 manifest.xml 中添加您的活动。

然后创建如下布局。

  • 作为家长,使用RelativeLayout
  • 放入 2 个子项(ScrollView 和底部视图)
  • 底视图aligned to bottom
  • ScrollView 位于above底部视图。

<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <ScrollView
        android:layout_above="@+id/bottomView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        //scrollable content
    </ScrollView>

    <RelativeLayout
        android:id="@+id/bottomView"
        android:layout_alignParentBottom="true"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        //your bottom content
    </RelativeLayout >
</RelativeLayout>
于 2017-05-07T20:31:49.940 回答