Android开发 ScrollView嵌套RelativeLayout、RecycleView(内容显示不全),RelativeLayout底部对齐失效

来源:互联网 发布:雀神32位授权码数据库 编辑:程序博客网 时间:2024/06/09 17:19

布局为这样:

    <?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—————————————

2 0