开源软件名称:PullRefreshListView
开源软件地址:https://gitee.com/gentlemanyc/PullRefreshListView
开源软件介绍:
#PullRefreshListView###运行截图: 最低版本要求:android 2.3.3(API level=10) 需要导入的jar包:nineoldandroids-2.4.0.jarandroid-support-v4.jar 使用方法:1.在xml中字义: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:app="http://schemas.android.com/apk/res/cc.core.pullrefresh" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context="cc.core.pullrefresh.MainActivity" > <cc.core.pullrefresh.PRListView android:id="@+id/listview" android:layout_width="fill_parent" android:layout_height="fill_parent" android:dividerHeight="10dp" app:header_img="@drawable/jb" app:header_textSize="14sp" /></LinearLayout> 2.在java代码中使用: listview = (PRListView) findViewById(R.id.listview); listview.setMode(PullRefreshAbsListViewBase.Mode.PULL_FROM_BOTTOM); listview.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, data)); listview.setOnRefreshListener(new OnRefreshListener() { @Override public void onHeaderRefresh() { //刷新操作 } @Override public void onFooterRefresh() { //加载更多 } }); |
请发表评论