我使用recycler视图创建了可扩展列表视图。但我想在scrollview中添加,我有一些图像和文本显示。所以我在滚动视图中添加了带有图像和文本的回收器。现在页面正在滚动,但回收者视图也是单独滚动。
<?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>
&#13;
答案 0 :(得分:0)
我使用嵌套滚动视图来解决此问题。嵌套滚动视图。这允许我向一个方向滚动