0

I am not using a navigation drawer . I only am using a menu.xml and i want to draw a line separating between these items. I am sure that the line is drawn but i think its color is white so i cannot see it , how can i change its color? Thank you

<menu 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"
    tools:context="com.orangelabs.crypto.blindstorage.android.poc.HomeActivity">


    <group android:checkableBehavior="none"
        android:id="@+id/group1">
    <item android:id="@+id/action_disconnect"
        android:title="@string/action_disconnect"
        app:showAsAction="never"/>
    <item android:id="@+id/action_upload"
        android:title="@string/action_upload"
        app:showAsAction="never">

    <menu>
        <item android:id="@+id/action_chiffre"
            android:title="@string/action_chiffre"
            app:showAsAction="never"/>
        <item android:id="@+id/action_non_chiffre"
            android:title="@string/action_non_chiffre"
            app:showAsAction="never"/>
    </menu>
</item>

    <item android:id="@+id/action_create_folder"
        android:title="@string/action_create_folder"
        app:showAsAction="never"/>
</group>
    <group android:checkableBehavior="none"
        android:id="@+id/group2">
        <item android:id="@+id/action_logs"
            android:title="@string/a_propos"
            app:showAsAction="never"/>

    </group>


</menu>
test appli
  • 33
  • 6

2 Answers2

-3
<View
android:height="1dp"
android:width="match_parent"
android: background="@android:color/grey"
/>

This is for navigation drawer, use this code in between the items.

For menu items, check this link: How to add line divider for menu item Android

  • I have tried this as well , using another layout as action_layout , but the divider doesn't seem to appear .... – test appli May 30 '17 at 16:07
-4
<View
android:layout_height="1dp"
android:layout_width="match_parent"
android:background="@android:color/darker_gray"
/>

Use this code inbetween the menu items.