I need to configure my navigation box, this is part of the code in res / menu / activity_main_drawer.xml
<item
android:title="Discover">
<menu>
<item
android:id="@+id/nav_qrcode"
android:icon="@drawable/read_qr"
android:title="QRCode" />
<item
android:id="@+id/favorite"
android:icon="@drawable/favorite"
android:title="favorite" />
</menu>
</item>
this is the layout in res / layout / activity_home.xml
<android.support.design.widget.NavigationView
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
android:background="#B59154"
app:itemTextColor="#ffffff"
app:menu="@menu/activity_main_drawer" />
I want to assign a background color to the first element, how can I do this?
"Discovery" is a category, and the rest is manù (clickable).
I don’t know how to assign a different layout to my “categories”.
user6309010
source
share