scwang90 / SmartRefreshLayout

🔥下拉刷新、上拉加载、二级刷新、淘宝二楼、RefreshLayout、OverScroll,Android智能下拉刷新框架,支持越界回弹、越界拖动,具有极强的扩展性,集成了几十种炫酷的Header和 Footer。
https://segmentfault.com/a/1190000010066071
Apache License 2.0
24.92k stars 4.95k forks source link

布局中包裹listvew使用经典下拉刷新,头布局始终显示在布局上 #166

Closed dingzhipengV closed 7 years ago

dingzhipengV commented 7 years ago

<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:background="@color/gray_f2"

<com.scwang.smartrefresh.layout.SmartRefreshLayout android:id="@+id/refreshLayout" android:layout_width="match_parent" android:layout_height="match_parent" app:srlEnableLoadmore="true"> <com.scwang.smartrefresh.layout.header.ClassicsHeader android:layout_width="match_parent" android:layout_height="wrap_content" app:srlClassicsSpinnerStyle="FixedBehind" app:srlFinishDuration="500" app:srlEnableLastTime="true" app:srlTextSizeTitle="16sp" app:srlTextSizeTime="10dp" app:srlTextTimeMarginTop="2dp" app:srlDrawableArrowSize="20dp" app:srlDrawableProgressSize="20dp" app:srlDrawableMarginRight="20dp" app:srlDrawableProgress="@drawable/ic_progress_hojder"/>

    <FrameLayout

        android:gravity="center"
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        <ImageView
            android:id="@+id/iv_none_show"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:src="@drawable/btn_camera_flash"
            android:visibility="gone"
            />
        <TextView
            android:layout_marginTop="10dp"
            android:layout_below="@+id/iv_none_show"
            android:id="@+id/tv_nomessage"
            android:layout_centerInParent="true"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textSize="16sp"
            android:text="您还没有消息"
            android:visibility="gone"
            />
        <ListView
            android:layout_marginTop="10dp"
            android:scrollbars="none"
            android:background="@color/white"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:divider="@color/gray_f2"
            android:dividerHeight="1dp"
            android:id="@+id/lis_notification"
            >
        </ListView>
    </FrameLayout>
            <com.scwang.smartrefresh.layout.footer.ClassicsFooter
                android:layout_width="match_parent"
                android:layout_height="wrap_content"/>
</com.scwang.smartrefresh.layout.SmartRefreshLayout>

scwang90 commented 7 years ago

去掉 app:srlClassicsSpinnerStyle="FixedBehind"