我有一个带有 Root View 的 ScrollView ,它是线性布局
在LinearLayout的底部有一个按钮
我想让它随着 ScrollView 向上滚动,但是当 View 第一次出现在屏幕上时 我希望按钮位于 View 的底部,但它不是
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/default_side_margin"
android:layout_marginRight="@dimen/default_side_margin"
android:orientation="vertical" >
<include
android:id="@+id/details"
layout="@layout/layout_details"
/>
<include
android:layout_gravity="bottom"
layout="@layout/layout_btn_next" />
</LinearLayout>
</ScrollView>
第一个包含的布局只占屏幕的一半左右
我希望按钮随着布局向上滚动,但要远离布局细节以位于屏幕底部
最佳答案
没有完全理解你的问题,但你应该在 ScrollView 上尝试 android:fillViewport=true,看这里: http://www.curious-creature.org/2010/08/15/scrollviews-handy-trick/
关于android - 如何使对象位于 ScrollView 的底部,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24186534/