布局为这样:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="none">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<!--提交订单-->
<TextView
android:id="@+id/frg_car_tv_commit_order"
android:textColor="@color/color_white"
android:gravity="center"
android:textSize="@dimen/text_size_18sp"
android:text="确认下单"
android:layout_alignParentBottom="true"
android:layout_marginTop="@dimen/size_10"
android:background="@drawable/shape_background_blue_only"
android:layout_width="match_parent"
android:layout_height="@dimen/size_49" />
<LinearLayout
android:layout_above="@id/frg_car_tv_commit_order"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
.....
....
</LinearLayout>
</RelativeLayout>
</ScrollView>
然后发现确认下单一直在顶部,其它的被顶到了屏幕外了。
解决方案,给ScrollView添加fillVeewport属性,并设为为true
—————————–2017年5月5日11:59:03—————————————
本文介绍了一个关于ScrollView布局的问题,即“确认下单”按钮始终显示在顶部,其余元素被推到屏幕之外的情况。通过设置fillViewport属性为true解决了该问题。
,RelativeLayout底部对齐失效&spm=1001.2101.3001.5002&articleId=71194684&d=1&t=3&u=8b5fbb77cbf04ad6a8a28b4d5a4621c2)
656

被折叠的 条评论
为什么被折叠?



