android 实现下拉刷新有很多开源的源码可以用 比如 :PullToRefreshListView  使用起来也很方便

现在还可以直接使用google libs下面的 android-support-v4.jar 这个包来实现了,请更新你的sdk到最新

使用 xml 布局

android:id="@+id/refresh"

android:layout_width="match_parent"

android:layout_height="match_parent"

>

android:layout_width="match_parent"

android:layout_height="match_parent"

android:id="@+id/listview"

>

最外层是 android.support.v4包里面的一个类 SwipeRefreshLayout ,在它里面放入任意view控件就行了。

代码里面:

SwipeRefreshLayout 具体的方法,大家看看api文档

项目里面的  android-support-v4.jar 可能没有SwipeRefreshLayout这个类,我已上传上来了,可以到这里下载

原文:http://blog.csdn.net/hhhccckkk/article/details/27340649

Logo

瓜分20万奖金 获得内推名额 丰厚实物奖励 易参与易上手

更多推荐