Skip to content Skip to sidebar Skip to footer

Selected Popup Menu Item Background Color Set

I just one to ask that is there anybody who can chanse background color of the selected menuitem? I was searching a lot in this topic and I didnt find any working solution yet :( S

Solution 1:

Style Named PopUp

 <selector>
    <?xml version="1.0" encoding="utf-8"?>
    <item android:drawable="@color/light_blue" android:state_selected="true"/>
    <item android:drawable="@color/light_blue" android:state_checked="true"/>
    <item android:drawable="@color/transparent"/>
  </selector>

apply android:background="@drawable/popup"

 <RadioButton
            android:id="@+id/rbID"
            android:text="check"
            android:background="@drawable/popup"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:checked="false"
            />

output ss

Unchecked

uncheck

Checked

checked

chenge @style/PopupMenu to android:background="@drawable/popup"

hope helpful for you


Post a Comment for "Selected Popup Menu Item Background Color Set"