【问题标题】:ConstraintLayout (with RecyclerView ) inside NestedScrollViewNestedScrollView 内的 ConstraintLayout (带有 RecyclerView )
【发布时间】:2019-04-26 02:56:42
【问题描述】:

当我尝试滚动 RecyclerView 的外部区域时,我有这样的结构它不起作用(滚动)

<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView 
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"  
android:fillViewport="true">

<androidx.constraintlayout.widget.ConstraintLayout
    android:id="@+id/root"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    >

    <androidx.cardview.widget.CardView     
    </androidx.cardview.widget.CardView>

    <androidx.recyclerview.widget.RecyclerView
     />

</androidx.constraintlayout.widget.ConstraintLayout>

对此有任何帮助!!!

【问题讨论】:

标签: android android-recyclerview kotlin android-constraintlayout android-nestedscrollview


【解决方案1】:

您可以尝试为RecyclerView - android:nestedScrollingEnabled="false" 添加此属性

【讨论】:

    【解决方案2】:

    NestedScrollView 换行 约束布局包装

    RecyclerView 包装

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-02
      • 1970-01-01
      • 2017-02-15
      • 2017-05-28
      • 1970-01-01
      • 2017-02-03
      相关资源
      最近更新 更多