当前位置:   article > 正文

Android nestedScrollView + tabLayout + viewPager + recyclerView布局 滑动冲突并且使得paging3加载更多失效的另类解决方法_tablayout+viewpager+recyclerview

tablayout+viewpager+recyclerview

最近碰到一个这样的需求,客户想要加一个下拉刷新的功能。我一看,这不是很简单。引入SmartRefreshLayout控件,唰唰刷几下布局就写好了。

这是主布局:

<?xml version="1.0" encoding="utf-8"?>
<com.ggh.michat.widget.PagingRecyclerViewContainer xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/white"
    android:orientation="vertical">

    <androidx.core.widget.NestedScrollView
        android:id="@+id/scrollView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fillViewport="true"
        android:scrollbars="none">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">

            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <com.google.android.material.tabs.TabLayout
                    android:id="@+id/chat_square_tab"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentStart="true"
                    app:tabGravity="center"
                    app:tabIndicatorFullWidth="false"
                    app:tabIndicatorHeight="0dp"
                    app:tabMode="scrollable"
                    app:tabRippleColor="@android:color/transparent" />

                <ImageView
                    android:layou
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/花生_TL007/article/detail/286527
推荐阅读
相关标签