Android 滚动外部recyclerview以显示内部recyclerview+;章节标题
我有一个内部recyclerView的以下布局,它是包含多个水平recyclerView的外部垂直recyclerView的一部分。正如您在上面的布局中所看到的,每个内部recyclerView都有一个节标题,但当向上滚动垂直recyclerView时,它只会聚焦水平recyclerView项,而TextView只是隐藏起来,需要再次点击dpad才能显示。 如何使垂直回收视图在向上滚动时显示标题 我尝试添加安卓:genderantfocusability=“blocksDescendants”Android 滚动外部recyclerview以显示内部recyclerview+;章节标题,android,xml,android-recyclerview,nestedrecyclerview,Android,Xml,Android Recyclerview,Nestedrecyclerview,我有一个内部recyclerView的以下布局,它是包含多个水平recyclerView的外部垂直recyclerView的一部分。正如您在上面的布局中所看到的,每个内部recyclerView都有一个节标题,但当向上滚动垂直recyclerView时,它只会聚焦水平recyclerView项,而TextView只是隐藏起来,需要再次点击dpad才能显示。 如何使垂直回收视图在向上滚动时显示标题 我尝试添加安卓:genderantfocusability=“blocksDescendants”
但这完全消除了我不想要的水平循环视图项的焦点。解决方案不是将外部循环视图放在滚动视图中,而是使用框架布局
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="?android:selectableItemBackground"
android:orientation="vertical"
android:padding="5dp">
<TextView
android:focusable="false"
android:focusableInTouchMode="false"
android:textColor="@color/white"
android:id="@+id/section_title"
android:textSize="@dimen/_10ssp"
android:layout_width="wrap_content"
android:padding="8dp"
android:layout_height="wrap_content"/>
<com.PersistentFocusWrapper
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<com.TvRecyclerView
android:layout_below="@id/section_title"
android:id="@+id/CarouselsRowRv"
android:focusable="false"
android:focusableInTouchMode="false"
android:orientation="horizontal"
android:layout_width="match_parent"
app:tv_selectedItemOffsetEnd="658dp"
android:layout_height="125.4dp" />
</com.PersistentFocusWrapper>
</LinearLayout>