创建NavigationView菜单以及ExpandableListView菜单

问题描述 投票:-3回答:1

我想创建菜单,如图像请帮助我。 我想创建navigationDrawerLayout,就像下面给出的图像一样

android navigation-drawer expandablelistview
1个回答
0
投票

如果您可以在导航抽屉中正确使用循环视图,则不需要可扩展列表视图但如果您仍想使用可扩展列表视图,则可以在此处使用它来代替循环视图。

需求

  • 回收视图或可扩展列表视图,而不是抽屉布局中的导航
  • 适用于Recycle视图的适配器或ExpandableListAdapter,如果您在此处使用可扩展列表视图
  • 标题的布局
  • 物品的布局
  • 在循环视图的情况下,适配器中的getItemViewType()方法将用于为您的标题和项目列表充气异构布局
  • 如果您仍想使用ExpandableListView参考 https://developer.android.com/reference/android/widget/ExpandableListView.html <RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent"> <include android:id="@+id/toolbar" layout="@layout/layout_toolbar" /> <FrameLayout android:id="@+id/fragment_container" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_above="@+id/tv_gps" android:layout_below="@+id/toolbar" /> <TextView android:id="@+id/tv_gps" android:layout_width="match_parent" android:layout_height="@dimen/dimen_24dp" android:layout_alignParentBottom="true" android:background="@color/colorHeader" android:gravity="center" android:text="@string/gps_off_message" android:textColor="@color/colorWhite" android:textSize="@dimen/dimen_12sp" android:visibility="gone" /> </RelativeLayout> <android.support.v7.widget.RecyclerView android:id="@+id/rv_navigation_menu" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="left" android:background="@mipmap/dark_bg" android:paddingBottom="@dimen/dimen_32dp" android:scrollbars="none" />
© www.soinside.com 2019 - 2024. All rights reserved.