SwipeRefresh
基于原生的SwipeRefreshLayout 做了封裝處理
此項(xiàng)目中包括種:
1.原生SwipeRefreshLayout(上拉可通過(guò)滾動(dòng)監(jiān)聽(tīng)實(shí)現(xiàn))
2.自定義支持上拉刷新的組件
3.自定義支持ViewPage的刷新組件VPSwipeRefreshLayout
4.RecyclerView+SwpieRefreshLayout實(shí)現(xiàn)下拉刷新效果同時(shí)實(shí)現(xiàn)上拉功能
1.原生SwipeRefreshLayout(上拉可通過(guò)滾動(dòng)監(jiān)聽(tīng)實(shí)現(xiàn))
除了OnRefreshListener接口外,SwipRefreshLayout中還有一些其他重要的方法,具體如下:
1、setOnRefreshListener(SwipeRefreshLayout.OnRefreshListener listener):設(shè)置手勢(shì)滑動(dòng)監(jiān)聽(tīng)器。
2、setProgressBackgroundColor(int colorRes):設(shè)置進(jìn)度圈的背景色(已經(jīng)棄用)
setProgressBackgroundColorSchemeResource (可以)。
setProgressBackgroundColorSchemeColor(Color c) (可以)
3、setColorSchemeResources(int… colorResIds):設(shè)置進(jìn)度動(dòng)畫(huà)的顏色。
4、setRefreshing(Boolean refreshing):設(shè)置組件的刷洗狀態(tài),顯示或者隱藏刷新進(jìn)度條
5、setSize(int size):設(shè)置進(jìn)度圈的大小,只有兩個(gè)值:DEFAULT、LARGE
6、postDelayed(new Runable(),long min) 設(shè)置刷新延遲時(shí)間
7、isRefreshing():檢查是否處于刷新?tīng)顟B(tài)
布局,具體內(nèi)容如下:
<?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:id="@+id/swipeLayout" > <ListView android:id="@+id/mylist" android:layout_width="match_parent" android:layout_height="wrap_content"/> </android.support.v4.widget.SwipeRefreshLayout>
分享標(biāo)題:android中SwipeRefresh實(shí)現(xiàn)各種上拉,下拉刷新示例-創(chuàng)新互聯(lián)
網(wǎng)站路徑:http://www.chinadenli.net/article30/dgehpo.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站設(shè)計(jì)公司、定制開(kāi)發(fā)、ChatGPT、外貿(mào)建站、全網(wǎng)營(yíng)銷(xiāo)推廣、網(wǎng)站設(shè)計(jì)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶(hù)投稿、用戶(hù)轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容