Android 如何实现这样的布局?

Android 如何实现这样的布局?,android,android-layout,android-recyclerview,Android,Android Layout,Android Recyclerview,我正在尝试做一个应用程序,将显示NHL排名,并希望从核心实现类似的东西。我最初的想法是这样做: <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal"> <androidx.recyclerview.widget.RecyclerV

我正在尝试做一个应用程序,将显示NHL排名,并希望从核心实现类似的东西。我最初的想法是这样做:

<LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="horizontal">

        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/teamNamesRecyclerView"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"/>

        <HorizontalScrollView
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1">

            <androidx.recyclerview.widget.RecyclerView
                android:id="@+id/teamStatsRecyclerView"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"/>

        </HorizontalScrollView>
    </LinearLayout>


该布局看起来像一个普通的表视图。您可以使用Androids默认的TableLayout视图来实现您的表,或者使用类似的库来实现这一点。

您可以将屏幕分成两半,在左侧实现列表视图,在右侧实现水平滚动视图。

我想是这样,但无法找到有关本机TableLayout的很多最新信息。您是否能够像使用RecyclerView一样使用列表填充它?我从未使用过androids表布局,但我想您可以通过使用一些循环将子项添加到父项来填充它,而不是在XML中使用31个标记<代码>对于(…{tablelayout.addView(createRow(item))}
它似乎非常过时,并且您链接的库(我以前找到过)似乎非常健壮,因此我将尝试一下。谢谢不客气。如果库不符合您的需要,您可以随时修改它//titles//put layout weight 1这几乎与我在原始帖子中的内容完全相同,只是我使用了RecyclerView而不是ListView