如何在導航抽屜中加下劃線菜單項?抽屜式導航列表中的下劃線菜單項
預期:
現實:
@菜單/ activity_navigation_drawer:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<group android:checkableBehavior="single">
<item
android:id="@+id/nav_open_account"
android:title="@string/na_navigate_open_account" />
<item
android:id="@+id/nav_login"
android:title="@string/na_navigate_login" />
<item
android:id="@+id/nav_stock_signals"
android:title="@string/na_navigate_stock_signals" />
...
</group>
導覽活動佈局:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="end">
<include
layout="@layout/app_bar_navigation"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<android.support.design.widget.NavigationView
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="end"
android:fitsSystemWindows="true"
android:background="@color/primary_asphalt_dark"
app:headerLayout="@layout/nav_header_navigation"
app:menu="@menu/activity_navigation_drawer" />
</android.support.v4.widget.DrawerLayout>
告訴我,如果更多的代碼需要。
太多的感謝!奇蹟般有效 – AnZ