Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

为任意View添加下拉刷新上拉加载更多的功能,支持NestedScrolling特性

License

NotificationsYou must be signed in to change notification settings

qstumn/RefreshLayout

Repository files navigation

Download

为任意View添加下拉刷新上拉加载更多的功能,支持NestedScrolling特性

how to use:

1. gradle

    compile'q.rorbin:QRefreshLayout:1.2.4'

VERSION_CODEhere

2. xml

    <q.rorbin.qrefreshlayout.QRefreshLayoutandroid:id="@+id/refreshlayout"android:layout_width="match_parent"android:layout_height="match_parent">                <ListViewandroid:id="@+id/listview"android:layout_width="match_parent"android:layout_height="match_parent"/>                </q.rorbin.qrefreshlayout.QRefreshLayout>

3. code

如果需要上拉加载更多功能,请调用以下方法

mRefreshLayout.setLoadMoreEnable(true);

设置监听

mRefreshLayout.setRefreshHandler(newRefreshHandler() {@OverridepublicvoidonRefresh(QRefreshLayoutrefresh) {dosomething...mRefreshLayout.refreshComplete();            }@OverridepublicvoidonLoadMore(QRefreshLayoutrefresh) {dosomething...mRefreshLayout.LoadMoreComplete();            }        });

如果你想自定义头部或者尾部的View,只需要将你的View继承自QLoadView或 实现ILoadView接口

  publicclassCustomViewextendsQLoadViewpublicclassCustomViewimplementsILoadView

  然后再设置进布局

mRefreshLayout.setHeaderView(newCustomView());  mRefreshLayout.setFooterView(newCustomView());

  LoadView已有三种实现类供您选择使用,分别为:HeaderView(FooterView)、MaterialHeaderView(MaterialFooterView)、MaterialBlackHeaderView(MaterialBlackFooterView),QRefreshLayout默认设置为HeaderView

4. 属性说明

xmlcode说明
app:resistancesetResistance设置下拉阻力(范围0f~1f)

LICENSE

Copyright 2016, RorbinQiuLicensed under the Apache License, Version 2.0 (the "License");you may not use this file except in compliance with the License.You may obtain a copy of the License at   http://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, softwaredistributed under the License is distributed on an "AS IS" BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.See the License for the specific language governing permissions andlimitations under the License.

About

为任意View添加下拉刷新上拉加载更多的功能,支持NestedScrolling特性

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2026 Movatter.jp