美文网首页
listview和swipeRefreshLayout冲突的解决

listview和swipeRefreshLayout冲突的解决

作者: Sample_610a | 来源:发表于2017-11-09 18:03 被阅读0次
    listview.setOnTouchListener(new View.OnTouchListener() {
    
    @Override
    
    public boolean onTouch(View v, MotionEvent event) {
    
    if (event.getAction() == MotionEvent.ACTION_MOVE) {
    
    Log.d("Measure","listview.getListPaddingTop():"+listview.getListPaddingTop()+" listview.getTop():"+listview.getTop()+"listview.getChildAt(0).getTop():"+listview.getChildAt(0).getTop());if (listview.getFirstVisiblePosition() ==0&&
    
    listview.getChildAt(0).getTop() >= listview.getListPaddingTop()) {
    
    refrashLayout.setEnabled(true);Log.d("TAG","reach top!!!");}else refrashLayout.setEnabled(false);}
    
    return false;}
    
    });
    

    相关文章

      网友评论

          本文标题:listview和swipeRefreshLayout冲突的解决

          本文链接:https://www.haomeiwen.com/subject/yssmmxtx.html