在eclipse上使用github上面的安卓开源项目

来源:互联网 发布:java权限管理系统 编辑:程序博客网 时间:2024/06/07 06:14
  1.  下载zip,解压到桌面
  2. 打开eclipse,File-Import-Existing Android Code Into Workspace
  3. 选中library文件,导入到eclipse中
  4. 打开此library,右键library,properties-Android-Library-勾选Is Library
  5. 打开你的程序后,右键你的主程序,properties-Android-Library-Add,选择library文件

导入的基本步骤就这样,接下来是如何使用
  1. 找到你的程序-layout-xml添加一个
    <com.handmark.pulltorefresh.library.PullToRefreshListView
    android:id="@+id/pull_to_refresh_listView" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent"/>
  2. 回到MainActivity中,头文件中添加一段代码
    import com.handmark.pulltorefresh.library.PullToRefreshListView; 
  3. 之后把你需要用到的listview全部改为PullToRefreshListView,例如
    private PullToRefreshListView mPullRefreshListView;
  4. 接着就像listview一样使用吧
0 0