我正在尝试制作一个显示 NHL 积分榜的应用程序,并希望从 theScore 中制作与此实现类似的东西。我最初的想法是做这样的事情:
<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>
但这不允许列标题随数据滚动(据我所知)。我该如何实现这样的设计?
这种布局看起来像一个普通的表格视图。您可以使用 Android 的默认 TableLayout 视图来实现您的表格,或者使用诸如https://github.com/evrencoskun/TableView 之类的库来解决该问题。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句