Android:RelativeLayout alignParentBottom与EditText重叠

Android:RelativeLayout alignParentBottom与EditText重叠,android,scrollview,android-relativelayout,overlap,Android,Scrollview,Android Relativelayout,Overlap,因此,我有以下布局: 问题在于,当键盘焦点位于TextView:txtPassword时,LinearLayout:LinearLayout1与TextView:txtPassword重叠 LinearLayout:LinearLayout1使用android:layout\u alignParentBottom=“true”将其保持在底部,但我不知道为什么当焦点放在TextView:txtPassword上时,LinearLayout:LinearLayout1只是重叠了它 <

因此,我有以下布局:


问题在于,当键盘焦点位于TextView:txtPassword时,LinearLayout:LinearLayout1TextView:txtPassword重叠

LinearLayout:LinearLayout1使用android:layout\u alignParentBottom=“true”将其保持在底部,但我不知道为什么当焦点放在TextView:txtPassword上时,LinearLayout:LinearLayout1只是重叠了它

 <LinearLayout
    android:id="@+id/LinearLayout1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_below="@id/txtPassword"
    android:layout_alignParentBottom="true" >

我建议您将整个RelativeLayout嵌入到滚动视图中,并在LinearLayout1中包含下面的android:layout_=“@+id/txtPassword”。布局不需要alignParentBottom=“true”。我在ScrollView中试用过,效果很好


您遗漏了一些按钮的边距对齐(仅供参考)

有两种方法,一种是将相对布局放在scrollview中,这在布局扩展时是一种很好的做法,另一种是从username edittext中删除页边空白顶部,这不起作用,因为它会将LinearLayout放在txtPassword的正下方,这使得布局\u alignParentBottom=“true”无用。
 <LinearLayout
    android:id="@+id/LinearLayout1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_below="@id/txtPassword"
    android:layout_alignParentBottom="true" >