代码拉取完成,页面将自动刷新
#PullRefreshListView ###运行截图:
android 2.3.3(API level=10)
nineoldandroids-2.4.0.jar android-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() {
//加载更多
}
});
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
1. 开源生态
2. 协作、人、软件
3. 评估模型