Open icqapp opened 7 years ago
已经解决!!! 可以这样改 @Override public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) { Log.d("AppBarLayout:","位移:"+verticalOffset); //xRefreshView.setPullRefreshEnable(verticalOffset == 0);//不能下拉 xRefreshView.setEnabled(verticalOffset == 0); }
当XRefreshView上拉使得AppBarLayout隐藏后,我设置AppBarLayout.addOnOffsetChangedListener(this);事件监听来设置XRefreshView的setPullRefreshEnable方法,但是不管用!!!XR还是不能下拉使得AppBarLayout显示出来 @Override public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) { Log.d("AppBarLayout:","位移:"+verticalOffset); xRefreshView.setPullRefreshEnable(verticalOffset == 0);//不能下拉 } xml代码如下
<?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:icqapp="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent">
</android.support.design.widget.CoordinatorLayout>