Code Monkey home page Code Monkey logo

pullrefreshview's Introduction

#PullRefreshListView ###运行截图: 输入图片说明 输入图片说明

最低版本要求:

android 2.3.3(API level=10)

需要导入的jar包:

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. 代码的字符编码为utf-8

更多API请你查看查看源码,欢迎你联系我给我提出bug和意见,此项目继续开发中

pullrefreshview's People

Contributors

gentlemanyc avatar

Stargazers

 avatar huangwei avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.