我遇到的问题似乎是,如果我有一个视图(例如myButton)内的RelativeLayout设置为alignParentBottom - (根据下面的代码) - 然后用scrollview包装RelativeLayout(必要的内容将是在较小的屏幕上或在方向改变为横向时可见) - 然后,当父级底部不可见时(例如,当更改为横向时)myButton显示在页面的顶部 - 而不是底部。Android的RelativeLayout:如何alignParentBottom包装在一个ScrollView?
如何将视图与屏幕底部对齐,并使底部保持在底部,即使底部位于滚动条下方?
<ScrollView
android:id="@+id/mainScrollView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
android:fillViewport="true">
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/topLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
... lots of views and stuff
<Button android:layout_alignParentBottom="true"
android:id="@+id/myButton"
android:text="Click Me" />
</RelativeLayout>
</ScrollView>
你知道怎么今天这个做什么? – 2016-09-04 19:08:45