SwipeRefreshLayout: Swipe progress animation

前端 未结 2 1255
无人及你
无人及你 2020-12-14 11:37

I\'m quite new to android and I\'m exploring the sample code on google website. The code I\'m on currently is the SwipeRefreshLayout: http://developer.android.com/samples/Sw

2条回答
  •  忘掉有多难
    2020-12-14 12:04

    although you can't change it, you can still hide it and then display your own once triggered :-)

    SwipeRefreshLayout swiperefresh = (SwipeRefreshLayout)root.findViewById(R.id.swiperefresh);
    swiperefresh.setOnRefreshListener(this);
    swiperefresh.setColorSchemeColors(0,0,0,0);
    swiperefresh.setProgressBackgroundColor(android.R.color.transparent); 
    

    Notes:

    • in eclipse you have to add @SuppressLint("ResourceAsColor") to compile this.

    • you still need to call setRefreshing(false) at an appropriate point in time else onRefresh doesn't trigger again.

提交回复
热议问题