滚动视图不适用于可扩展的回收站视图

拉胡尔

我已经使用回收站视图创建了可扩展列表视图。但是我想在滚动视图中添加一些要显示的图像和文本。因此,我在滚动视图中添加了该回收器以及这些图像和文本。现在页面正在滚动,但是回收者视图也在分别滚动。

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context="com.example.soulsystem_4.myapplication.ProjectDetails">

    <ScrollView
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
  <LinearLayout
      android:orientation="vertical"
      android:id="@+id/project"
      android:layout_width="match_parent"
      android:layout_height="match_parent">

    <LinearLayout
        android:id="@+id/top"
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <!--First linear section-->
        <LinearLayout
            android:orientation="vertical"
            android:layout_weight="0.2"
            android:layout_width="match_parent"
            android:layout_height="250dp"
            android:background="@color/bg_login">
            <ImageView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentTop="true"
            android:id="@+id/imageViewProjdetail"
            android:adjustViewBounds="true"
            android:scaleType="fitXY"/></LinearLayout>

        <!--Second linear section-->
        <LinearLayout
            android:orientation="vertical"
            android:layout_weight="0.25"
            android:layout_width="match_parent"
            android:layout_height="150dp"
            android:background="@color/Red_OrangeRed">

            <LinearLayout
                android:orientation="vertical"
                android:layout_weight="0.6"
                android:layout_width="match_parent"
                android:layout_height="match_parent">
                <TextView
                    android:id="@+id/price"
                    android:layout_weight="1"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent" />
                <TextView
                    android:id="@+id/morgage"
                    android:layout_weight="1"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent" />
            </LinearLayout>
            <LinearLayout
                android:paddingBottom="10dp"
                android:orientation="horizontal"
                android:layout_weight="0.4"
                android:layout_width="match_parent"
                android:layout_height="match_parent">
                <LinearLayout
                    android:orientation="vertical"
                    android:layout_width="0dp"
                    android:layout_height="match_parent"
                    android:layout_weight="0.75">
            <LinearLayout
                android:layout_weight="1"
                android:layout_width="match_parent"
                android:layout_height="match_parent">
                <TextView
                    android:lines="3"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent" />
            </LinearLayout>
            <LinearLayout
                android:orientation="horizontal"
                android:layout_weight="2"
                android:layout_width="match_parent"
                android:layout_height="match_parent">
                <TextView
                    android:id="@+id/bedroom"
                    android:layout_width="wrap_content"
                    android:layout_height="match_parent" />
                <TextView
                    android:id="@+id/bathroom"
                    android:layout_width="wrap_content"
                    android:layout_height="match_parent" />
                <TextView
                    android:id="@+id/sqft"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content" />
            </LinearLayout>
            </LinearLayout>
                <LinearLayout
                    android:layout_width="0dp"
                    android:layout_height="match_parent"
                    android:layout_weight="0.25"></LinearLayout>
            </LinearLayout>
        </LinearLayout>
        <View
            android:layout_width="match_parent"
            android:layout_height="1dp"
            android:background="?android:attr/listDivider"/>
        <!--Third linear-->
        <LinearLayout
            android:layout_weight="0.25"
            android:orientation="vertical"
            android:layout_width="match_parent"
            android:layout_height="150dp"
            android:background="@color/Brown_Chocolate"></LinearLayout>
    </LinearLayout>

    <LinearLayout
        android:layout_below="@+id/top"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        android:scrollbars="none">

        <android.support.v7.widget.RecyclerView
            android:id="@+id/recycler_view"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />

    </LinearLayout>



    <View
        android:layout_width="match_parent"
        android:layout_height="2dp"
        android:background="?android:attr/listDivider"/>

<!--Bottom fixed section-->
  </LinearLayout>
    </ScrollView>
    <LinearLayout
        android:background="@drawable/shape_radious"
        android:gravity="center"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true">
        <ImageView
            android:background="@mipmap/ic_launcher"
            android:layout_gravity="center"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />
        <TextView
            android:paddingLeft="5dp"
            android:textColor="@color/white"
            android:textAlignment="center"
            android:text="REQUEST INFO"
            android:gravity="center"
            android:layout_width="wrap_content"
            android:layout_height="match_parent" />
    </LinearLayout>
</RelativeLayout>

拉胡尔

我使用嵌套滚动视图来解决此问题。嵌套滚动视图。这使我可以向一个方向滚动

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章