I am trying to grey out my menu item text when it is disabled but am having trouble getting it to work. My menu.xml file is;
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<group
android:checkableBehavior="single">
<item
android:id="@+id/item1"
android:checked="false"
android:icon="@drawable/icon_item1"
android:title="item1"
app:actionLayout="@layout/item1Counter"/>
<item
android:id="@+id/about_us"
android:checked="false"
android:title="About Us" />
</group>
</menu>
I disable the menu item above by the following:
var menu1 = menuList.Menu.GetItem(0);
menu1.SetEnabled(false);
//Here is where I want to grey out the icon
Anyone know how I could do that. Also, item1Counter is the item action layout which also has text that will be greyed out. I want everything in item to be greyed out when after I disable it. Anyone know how I can do that?
question from:https://stackoverflow.com/questions/65927946/android-xamarin-grey-out-menu-item-in-c-sharp