android---ScrollView+ConstraintLayout+RecyclerView尾部item加载不全
RecyclerView嵌套一层RelativeLayout即可解决<androidx.constraintlayout.widget.ConstraintLayoutandroid:id="@+id/main"android:layout_width="match_parent"android:layout_height="match_parent"app:layout_constrain
·
RecyclerView嵌套一层RelativeLayout即可解决
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constrainedWidth="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ScrollView
android:layout_width="0dp"
android:layout_height="0dp"
android:fillViewport="true"
android:scrollbars="none"
app:layout_constrainedWidth="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/head">
<!-- 1.将RecyclerView 用 RelativeLayout 包裹 -->
<RelativeLayout
android:id="@+id/comment_detail"
app:layout_constraintTop_toBottomOf="@+id/sort"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/xxxx"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:nestedScrollingEnabled="false" />
<!-- 2.android:nestedScrollingEnabled="false" 禁止滑动 -->
</RelativeLayout>
</ScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>
更多推荐
已为社区贡献1条内容
所有评论(0)