我尝试在DividerItemDecoration
中的项目之间设置分隔符,我尝试使用<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- As the main content view, the view below consumes the entire
space available using match_parent in both dimensions. -->
<FrameLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<android.support.design.widget.NavigationView
android:id="@+id/nav_view"
android:layout_height="match_parent"
android:layout_width="wrap_content"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:customTypeface="@string/font_lato_light"
app:itemTextColor="@color/drawer_text_color_selector"
app:itemTextAppearance="@style/TextViewBody"
app:itemIconTint="@color/mainBlue"
app:itemBackground="@drawable/menu_item_bg"
app:menu="@menu/drawer_view"/>
</android.support.v4.widget.DrawerLayout>
,但它并没有完全符合我的要求。
MainActivity布局:
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:context=".MainActivity">
<item android:title="@string/historico" >
<menu>
<item
android:id="@+id/menu_historico"
android:icon="@drawable/user"
android:title="@string/historico" />
</menu>
</item>
<item android:title="@string/pagamento">
<menu>
<item
android:id="@+id/menu_pagamento"
android:icon="@drawable/user"
android:title="@string/pagamento" />
</menu>
</item>
<item android:title="@string/definicoes">
<menu>
<item
android:id="@+id/menu_terms"
android:icon="@drawable/user"
android:title="@string/terms" />
<item
android:id="@+id/menu_lang"
android:icon="@drawable/user"
android:title="@string/alterar_idioma" />
<item
android:id="@+id/menu_pass"
android:icon="@drawable/user"
android:title="@string/gestao_pass" />
<item
android:id="@+id/menu_ped"
android:icon="@drawable/user"
android:title="@string/gestao_ped" />
<item
android:id="@+id/menu_info"
android:icon="@drawable/user"
android:title="@string/informacao_pessoal" />
<item
android:id="@+id/menu_faqs"
android:icon="@drawable/user"
android:title="@string/faqs" />
<item
android:id="@+id/menu_suggest"
android:icon="@drawable/user"
android:title="@string/Sugestoes" />
<item
android:id="@+id/menu_end_session"
android:icon="@drawable/user"
android:title="@string/terminar_sessao" />
</menu>
</item>
这是我的菜单
mice
有没有在项目和子项目之间添加不同的分隔符?