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?
问问题
391 次
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 回答