回滚视图内滚动视图不滚动

时间:2016-11-22 13:55:29

标签: android-layout android-recyclerview android-scrollview recycler-adapter nestedscrollview

回滚视图不在滚动视图中滚动。我使用嵌套滚动视图,但它也不起作用。这是我的xml代码

activity_main.xml中

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/coordinatorlayout"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true">


    <include layout="@layout/content_main" />


    <android.support.design.widget.AppBarLayout
        android:id="@+id/appbarlayout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:theme="@style/AppTheme.AppBarOverlay"
        app:behavior_scrolling_appbar_peek_height="@dimen/bottom_sheet_peek_height"
        app:layout_behavior="com.example.deepdepindersingh.adore.ui.lib.ScrollingAppBarLayoutBehavior">

    </android.support.design.widget.AppBarLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@android:color/white"
        app:behavior_peekHeight="@dimen/bottom_sheet_peek_height"
        android:paddingTop="8dp"
        android:paddingStart="16dp"
        android:paddingEnd="16dp"
        android:paddingBottom="8dp"
        android:id="@+id/bottom_sheet"
        app:layout_behavior="com.example.deepdepindersingh.adore.ui.lib.BottomSheetBehaviorGoogleMapsLike"
        app:anchorPoint="@dimen/anchor_point"
        android:fitsSystemWindows="true">

        <ScrollView
            android:fillViewport="true"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:nestedScrollingEnabled="true"
            android:layout_below="@+id/llOptions">



            <android.support.v7.widget.RecyclerView
                android:id="@+id/recyclerView"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_marginBottom="16dp"
                android:layout_marginTop="16dp"
                android:background="#fff">

            </android.support.v7.widget.RecyclerView>
        </ScrollView>
    </LinearLayout>





    <android.support.design.widget.FloatingActionButton
        android:id="@+id/fab"
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"
        app:layout_anchor="@id/bottom_sheet"
        app:layout_anchorGravity="top|right|end"
        android:src="@android:drawable/ic_dialog_map"
        android:layout_margin="@dimen/fab_margin"
        app:layout_behavior="com.example.deepdepindersingh.adore.ui.lib.ScrollAwareFABBehavior"
        android:clickable="true"/>


</android.support.design.widget.CoordinatorLayout>

我正在使用网格适配器来显示数组列表

网格Single.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:padding="5dp">
    <ImageView
        android:id="@+id/grid_image"
        android:layout_width="50dp"
        android:layout_height="50dp">
    </ImageView>

    <TextView
        android:id="@+id/grid_text"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="15dp"
        android:textSize="9sp" />

</LinearLayout>

请帮助解决我的问题。

0 个答案:

没有答案