Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/222.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何在滑动嵌套回收视图时禁用SwiperFreshLayout';卡德维尤酒店_Android - Fatal编程技术网

Android 如何在滑动嵌套回收视图时禁用SwiperFreshLayout';卡德维尤酒店

Android 如何在滑动嵌套回收视图时禁用SwiperFreshLayout';卡德维尤酒店,android,Android,当我在SwipperFreshLayout中稍微向下滑动卡片时,它认为我在尝试刷新。如何避免这种情况?如果您有一个嵌套的RecyclerView,例如,名为RecyclerView,您可以调用: recyclerView.setNestedScrollingEnabled(false); 当您向下滑动嵌套的RecyclerView的子视图时,应停止您的SwiperFreshLayout尝试刷新。 与全能者一起为我工作。 希望有帮助:)如果这对您不起作用,我会尝试在您开始拖动时将触发距离设置为一


当我在SwipperFreshLayout中稍微向下滑动卡片时,它认为我在尝试刷新。如何避免这种情况?

如果您有一个嵌套的
RecyclerView
,例如,名为
RecyclerView
,您可以调用:

recyclerView.setNestedScrollingEnabled(false);
当您向下滑动嵌套的RecyclerView的子视图时,应停止您的
SwiperFreshLayout
尝试刷新。

与全能者一起为我工作。

希望有帮助:)

如果这对您不起作用,我会尝试在您开始拖动时将触发距离设置为一个非常高的值,例如:
mSwipteRefreshLayout.setDistanceToTriggerSync(Integer.MAX_value);mSwipteRefreshLayout.setEnabled(false)然后,当您想将其设置为再次刷卡时:
mSwipteRefreshLayout.setDistanceToTriggerSync((int)(getResources().getDisplayMetrics().density*64));mSwipteRefreshLayout.setEnabled(true)setNestedScrollingEnabled(false)
阻止子
RecyclerViews
触发父
RecyclerViews
SwipeRefreshLayout