如何解决如何在Android TV应用中使用RecyclerView?
我正在Android TV应用程序中使用RecyclerView。当我使用D-pad时会发生焦点移动。
例如,当我右转3次时,它就会下降。
您在Android电视应用程序中使用哪种结构?我在等你的建议。 我必须解决此错误。
我的布局文件如下:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.SlidingPaneLayout
android:background="#000000"
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:id="@+id/sPanelLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.constraint.ConstraintLayout
android:id="@+id/clSlideMenu"
android:layout_width="60dp"
android:layout_height="match_parent"
android:background="#000000"
android:orientation="vertical">
<ImageView
android:id="@+id/ivLogo"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginStart="1dp"
android:layout_marginTop="4dp"
android:background="@drawable/atlasnewlogo"
android:scaleType="center"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<android.support.v7.widget.RecyclerView
android:id="@+id/rvLeftMenu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:layout_marginBottom="16dp"
android:background="#000000"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@+id/ivLogo"
app:layout_constraintVertical_bias="0.0"
tools:layout_editor_absoluteX="4dp" />
</android.support.constraint.ConstraintLayout>
<android.support.constraint.ConstraintLayout
android:background="#000000"
android:id="@+id/flContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="55dp"
android:textSize="40sp">
<android.support.v4.widget.NestedScrollView
android:background="#000000"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.constraint.ConstraintLayout
android:id="@+id/clMain"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#000000">
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="4dp"
android:text="Now on Tv"
android:textColor="#ffffff"
android:textSize="20sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/slMainboard" />
<android.support.v7.widget.RecyclerView
android:focusable="false"
android:id="@+id/rvNowPlayProgram"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:background="#000000"
app:layout_constraintTop_toBottomOf="@+id/textView"
tools:layout_editor_absoluteX="0dp">
</android.support.v7.widget.RecyclerView>
<android.support.v7.widget.RecyclerView
android:id="@+id/rvContent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:background="#000000"
android:nestedScrollingEnabled="false"
app:layout_constraintTop_toBottomOf="@+id/rvNowPlayProgram"
tools:layout_editor_absoluteX="0dp">
</android.support.v7.widget.RecyclerView>
<com.saatteknoloji.atlastv.ui.home.slider.SliderLayout
android:id="@+id/slMainboard"
android:layout_width="match_parent"
android:layout_height="380dp"
android:background="#000000"
app:layout_constraintTop_toTopOf="parent"
tools:layout_editor_absoluteX="0dp">
</com.saatteknoloji.atlastv.ui.home.slider.SliderLayout>
</android.support.constraint.ConstraintLayout>
</android.support.v4.widget.NestedScrollView>
</android.support.constraint.ConstraintLayout>
</android.support.v4.widget.SlidingPaneLayout>
如何解决此错误?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。