滚动无法正常使用

时间:2018-08-19 14:47:31

标签: android android-tv

我有以下情况,当我按下控件上的按钮时,什么也没有发生……滚动条仅向下和向侧面滑动……有人知道这种奇怪行为的原因吗?

我有一个片段,在这个片段内称为布局。

<android.support.v4.widget.NestedScrollView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/NestedScrollViewCategoria"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <LinearLayout
        android:descendantFocusability="blocksDescendants"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        tools:ignore="UselessParent">

        <TextView
            android:id="@+id/IDExibeNomeCategoriaFilmes"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:paddingLeft="20dp"
            android:paddingTop="10dp"
            android:layout_marginBottom="5dp"
            android:textColor="@color/white_greyish"
            android:textSize="19sp"
            android:textStyle="bold"
            android:paddingStart="20dp"
            tools:ignore="RtlSymmetry" />

        <android.support.v7.widget.RecyclerView
            android:id="@+id/IDExibeCategoriaFilmes"
            android:shadowColor="@color/colorPrimary"
            android:shadowDx="1"
            android:shadowDy="1"
            android:shadowRadius="2"
            android:paddingLeft="5dp"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:clipToPadding="false"
            android:scrollbars="none"
            android:paddingStart="5dp"
            tools:ignore="RtlSymmetry" />

        <ProgressBar
            android:id="@+id/main_progress_filmes_categoria"
            android:background="@color/background_color"
            android:theme="@style/AppTheme.WhiteAccent"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"/>

        <android.support.v7.widget.RecyclerView
            android:id="@+id/IDCategoriaPesquisa"
            android:shadowColor="@color/colorPrimary"
            android:shadowDx="1"
            android:shadowDy="1"
            android:shadowRadius="2"
            android:paddingLeft="0dp"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:clipToPadding="false"
            android:scrollbars="none"
            android:paddingStart="0dp"
            android:visibility="gone"
            tools:ignore="RtlSymmetry" />

    </LinearLayout>

</android.support.v4.widget.NestedScrollView>

1 个答案:

答案 0 :(得分:1)

将此行添加到Both Both recyclerView xml中:

android:nestedScrollingEnabled =“ false”

或两个RecyclerView的Java代码中:

RecyclerView.setNestedScrollingEnabled(false);