我正在尝试使RecyclerView看起来像下面的Sections

我正在使用mvvmcross和到目前为止的xml是这样的:

<MvvmCross.Droid.Support.V7.RecyclerView.MvxRecyclerView
    android:id="@+id/recyclerView"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_weight="1"
    fab:MvxBind="ItemsSource EmballageGroups"
    fab:MvxTemplateSelector="Hocras.OnRoute.Droid.TypeTemplateSelector,Hocras.OnRoute.Droid" />


但这是一个没有节的简单列表。如何在其中找到板块? (必须按产品类型细分)

最佳答案

在这里查看示例https://github.com/MvvmCross/MvvmCross-Samples/tree/master/WorkingWithCollections

它使用MvxExpandableListView

<Mvx.MvxExpandableListView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    local:MvxItemTemplate="@layout/listitem_kitten"
    local:MvxGroupItemTemplate="@layout/listitem_expandablegroup"
    local:MvxBind="ItemsSource KittenGroups" />

关于android - mvvmcross android中的RecyclerView部分,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/42508922/

10-12 06:27