【发布时间】:2020-06-01 08:00:05
【问题描述】:
我在nestedScrollView 中有一个recyclerview,我已经停止滚动recyclerview 以允许nestedScrollView 滚动所有页面,但nestedScrollView 不起作用。
我已将recyclerview 的nestedScrollingEnabled 设置为false
我试图在recyclerview 下添加一个隐藏视图,但它显示在recyclerview 底部项目的顶部
我的布局xml文件代码是:
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<variable
name="viewModel"
type="com.accad.accadgame.viewmodels.profile.ProfileViewModel" />
</data>
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/circleImageView"
android:layout_width="75dp"
android:layout_height="0dp"
android:layout_marginStart="@dimen/default_dim"
android:layout_marginTop="@dimen/default_xxdim"
android:layout_marginEnd="@dimen/default_dim"
android:src="@drawable/profile"
app:layout_constraintDimensionRatio="h,1:1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/profile_name"
style="@style/HeadlineTextViewActiveStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/default_dim"
android:layout_marginStart="@dimen/default_dim"
android:layout_marginEnd="@dimen/default_dim"
android:text="@{viewModel.profileName}"
app:layout_constraintEnd_toEndOf="@+id/circleImageView"
app:layout_constraintStart_toStartOf="@+id/circleImageView"
app:layout_constraintTop_toBottomOf="@+id/circleImageView"
tools:text="@tools:sample/lorem" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/profile_details_list"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="@dimen/default_xxdim"
android:clipToPadding="false"
android:paddingBottom="@dimen/default_dim"
android:paddingStart="@dimen/default_dim"
android:nestedScrollingEnabled="false"
app:layout_constraintBottom_toBottomOf="parent"
android:focusable="false"
app:layout_constraintTop_toBottomOf="@id/profile_name"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
【问题讨论】:
标签: android android-recyclerview android-nestedscrollview