码迷,mamicode.com
首页 > 移动开发 > 详细

Android --SwipeRefreshLayout 下拉刷新

时间:2015-09-16 09:44:04      阅读:151      评论:0      收藏:0      [点我收藏+]

标签:

1、Layout

   <android.support.v4.widget.SwipeRefreshLayout
        android:id="@+id/id_swipe_ly"
        android:layout_width="match_parent"
        android:layout_height="match_parent" >
    <com.github.mikephil.charting.charts.LineChart
        android:id="@+id/chart1"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />
    </android.support.v4.widget.SwipeRefreshLayout>

2、初始化

/**
     * 下拉刷新SwipeRefreshLayout
     */
    private SwipeRefreshLayout mswipeLayout;

mswipeLayout =(SwipeRefreshLayout)findViewById(R.id.id_swipe_ly);
        mswipeLayout.setOnRefreshListener(this);
        mswipeLayout.setColorSchemeResources(android.R.color.holo_blue_light, android.R.color.holo_blue_light,
                android.R.color.holo_blue_light, android.R.color.holo_blue_light);

 

3、继承接口

implements OnChartValueSelectedListener
        ,SwipeRefreshLayout.OnRefreshListener

    @Override
    public void onRefresh()
    {
        mHandler.sendEmptyMessageDelayed(0, 1000);
    }

 

Android --SwipeRefreshLayout 下拉刷新

标签:

原文地址:http://www.cnblogs.com/bmbh/p/4812224.html

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