使用滑动以在Drawer布局内刷新时,不显示Recyclerview

时间:2017-02-26 14:36:24

标签: android pull-to-refresh android-navigation-drawer

我正在实现滑动以刷新抽屉布局中的相对布局 。一旦添加它,刷新刷新之前一切正常,convertlerview元素没有显示

我在下面添加了我的布局

<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout 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"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    tools:context="com.example.pratheesh.madfest_sample.Mainpage"
    android:background="@color/feed_bg"
    android:id="@+id/drawerlayout"
    >



    <ScrollView

        android:layout_width="match_parent"
        android:layout_height="match_parent"
        >

        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical"
            >
    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">

    <include layout="@layout/activity_madfext__toolbar"
        android:id="@+id/mainpage_toolbar"
            >
    </include>

        <android.support.v7.widget.CardView
            android:layout_width="match_parent"
            android:layout_height="80dp"
            tools:context="com.example.pratheesh.madfest_sample.CardRow"
            android:background="@drawable/feed_background"
            android:layout_marginLeft="5dp"
            android:layout_marginRight="5dp"
            android:layout_marginTop="5dp"
            android:paddingBottom="10dp"
            android:paddingTop="10dp"
            android:id="@+id/mainpage_add"
            android:layout_below="@+id/mainpage_toolbar"
            >



            <RelativeLayout
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"

                android:paddingBottom="@dimen/feed_item_padding_top_bottom"
                android:paddingTop="@dimen/feed_item_padding_top_bottom"
                android:paddingLeft="@dimen/feed_item_padding_left_right"
                android:paddingRight="@dimen/feed_item_padding_left_right" >

            <com.example.pratheesh.madfest_sample.AspectRatioImageView
                android:layout_width="60dp"
                android:layout_height="60dp"
                android:src="@drawable/images"
                android:id="@+id/mainpage_imageview_profile1"
                android:scaleType="fitCenter"
                android:layout_centerVertical="true"

                />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="Click to add Feeds"
                    android:id="@+id/mainpage_feeds"
                    android:textStyle="normal"
                    android:textColor="#000000"
                    android:layout_centerVertical="true"
                    android:layout_toRightOf="@+id/mainpage_imageview_profile1"
                    android:layout_margin="5dp"
                    android:layout_marginTop="5dp"/>

                </RelativeLayout>

        </android.support.v7.widget.CardView>


        <android.support.v4.widget.SwipeRefreshLayout
            android:id="@+id/swipe_refresh_layout"
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <android.support.v7.widget.RecyclerView
                android:id="@+id/my_recycler_view"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:scrollbars="vertical"
                android:layout_marginTop="0dp"
                android:layout_below="@+id/mainpage_add"/>
        </android.support.v4.widget.SwipeRefreshLayout>




    </RelativeLayout>

    </FrameLayout>
    </ScrollView>

    <android.support.design.widget.NavigationView
        android:layout_width="240dp"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:id="@+id/navigationview"
        app:menu="@menu/drawer"
        app:headerLayout="@layout/activity_navigation_header"
        app:itemTextAppearance="@style/NavigationDrawerStyle"
        >
    </android.support.design.widget.NavigationView>

</android.support.v4.widget.DrawerLayout>

0 个答案:

没有答案