【发布时间】:2014-03-18 17:05:31
【问题描述】:
我有以下代码:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/background_box">
<ScrollView
android:id="@+id/main_scroll"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true">
[... center stuff]
</ScrollView>
<RelativeLayout
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:id="@+id/auth_non_auth_bottom"
android:layout_below="@+id/main_scroll">
[... buttons and stuff]
</RelativeLayou>
</RelativeLayout>
在 Scrollview 里面有一个 EditText。由于 EditText 可以更改其高度,因此 Scrollview 可以越过 RelativeLayout 将其推到视图之外!
但是,如果我将 RelativeLayout 与 parentBottom 放在一起,它会在键入时隐藏编辑文本的键盘上方,因此用户无法编写......如果我将 RelativeLayout 放在滚动视图中......它不会位于视图的底部。
有什么想法可以实现将 RelativeLayout 置于底部但不隐藏 EditText(位于中心区域)的目标吗?谢谢!
【问题讨论】: