最近要实现如何如图效果:

SwipeRefreshLayout 首次打开出现加载图标-LMLPHP

主要是在初始化,代码如下:

, getResources().getDimensionPixelSize(typed_value.resourceId));
    refreshLayout.setRefreshing(true);
}

Activity如下:

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.ayout);
    refreshLayout = (SwipeRefreshLayout) this.findViewById(R.id.refresh_layout);
    refreshLayout.setOnRefreshListener(this);
    setSwipeRefresh();
    //设置颜色
    refreshLayout.setColorSchemeResources(R.color.green,R.color.gray, R.color.blue_50, R.color.light_white);
}

04-15 18:38