tangjiarao

Results 1 issues of tangjiarao

我的xml结构是 -CoordinatorLayout --AppBarLayout ----VideoView //隐藏 ----SlidingTabLayout //不隐藏 --AppBarLayout --TwinklingRefreshLayout ----ViewPager --TwinklingRefreshLayout -CoordinatorLayout viewPager下是fragment,fragment下是recycleView 按照作者提供的CollapsingToolbarLayout嵌套TwinklingRefreshLayout方法使用时,发现触摸屏幕缓慢向上移动会出现闪屏,不管是在viewPager下的fragment外嵌套TwinklingRefreshLayout还是在viewpager外嵌套TwinklingRefreshLayout。 是该方法导致 refreshLayout.setNestedScrollingEnabled(false); 这个方法应该是让TwinklingRefreshLayout跟随着CollapsingToolbarLayout移动。当设置为false时不再闪屏,但是触摸屏幕上下拖动无法再移动,或者移动不流畅。 我解决方法是 当recyclerView滑到顶部或底部时才能使用TwinklingRefreshLayout 步骤: 1.refreshLayout.setNestedScrollingEnabled(false);设置为false,setrefresh 及setLoadmore也设置为false,setOverScroll也设置为false,此时相当于TwinklingRefreshLayout不起作用 2.判断recyclerView的滑动状态及是否滑动到底部及顶部 当recyclerView向下滑,且滑动到底部时,setLoadmore方法设置true 当recyclerView在滑动时,执行步骤1操作 当recyclerView向上滑,且滑动到顶部时,setrefresh 方法设置为true 本人小白,提出一个自己的解决方法,希望能帮到其他人,如果有更好的请告诉我。