如下图出现了滑动冲突,尺码是一个recyclerview 它可以横向滑动,会把活动时间消费掉.这样CollapsingToolbarLayout就不会响应折叠.大的recyclerview就回出现滑动.
解决方案:
/**
* Enable nested scrolling.
*
* <p>This is a delegate method. Call it from your {@link android.view.View View} subclass
* method/{@link android.support.v4.view.NestedScrollingChild} interface method with the same
* signature to implement the standard policy.</p>
*
* @param enabled true to enable nested scrolling dispatch from this view, false otherwise
*/
public void setNestedScrollingEnabled(boolean enabled) {
if (mIsNestedScrollingEnabled) {
ViewCompat.stopNestedScroll(mView);
}
mIsNestedScrollingEnabled = enabled;
}
大意:启用嵌套滚动,参数启用为true以从此视图启用嵌套滚动调度,否则为false
内部嵌套的recyclerview调用setNestedScrollingEnabled(false);
就可以解决了.