recyclerview 中的水平 youtube 播放列表,如 Youtube kids App

问题描述

我正在尝试在 android 应用程序中以水平/横向格式显示 youtube 播放列表,就像 youtube kids 应用程序的工作方式。这是xml代码

<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">

<Spinner
    android:id="@+id/youtube_playlist_spinner"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentTop="true"/>
<horizontalscrollview
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_below="@+id/youtube_playlist_spinner">
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="horizontal">

        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/youtube_recycler_view"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="horizontal" />

    </LinearLayout>
</horizontalscrollview>
但到目前为止,我没有任何运气。播放列表继续以垂直格式显示,但如果我旋转手机,应用程序会因“Youtube 播放列表停止”而崩溃。任何帮助,将不胜感激。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)