码迷,mamicode.com
首页 > 其他好文 > 详细

XListview

时间:2017-08-15 23:11:16      阅读:190      评论:0      收藏:0      [点我收藏+]

标签:xlistview


需要导入library


 //找控件
        xlv = (XListView) findViewById(R.id.xlv);
        xlv.setPullRefreshEnable(true);
        xlv.setPullLoadEnable(true);
        //设置刷新监听
        xlv.setXListViewListener(new XListView.IXListViewListener() {
            @Override
            public void onRefresh() {

                Toast.makeText(MainActivity.this, "下拉刷新", Toast.LENGTH_SHORT).show();
            
                handler.postDelayed(new Runnable() {
                    @Override
                    public void run() {

                        //停止

                        xlv.stopRefresh();
                    }
                }, 2000);
            }

            @Override
            public void onLoadMore() {
        Toast.makeText(MainActivity.this, "上拉加载", Toast.LENGTH_SHORT).show();                                handler.postDelayed(new Runnable() {
                    @Override
                    public void run() {
                        //停止
                        xlv.stopLoadMore();
                    }
                }, 2000);
            }
        });

XListview

标签:xlistview

原文地址:http://13217579.blog.51cto.com/13207579/1956447

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!