SwiperefreshLayout in Android

后端 未结 7 2137
半阙折子戏
半阙折子戏 2020-12-09 03:58

i am using SwipeRefreshLayout in my below layout:




        
7条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-09 04:37

    Just create a class which extends SwipeRefreshLayout and override the method canChildScrollUp(). Return true when you want scroll down for your control.

    For example for scrollview you may try this,

    @override.
    boolean canChildScrollUp()
    {
       //your condition to check scrollview reached at top while scrolling
       if(scrollview.getScrollY() == 0.0)
          return true;
       else
          return false;
    }
    

提交回复
热议问题