Questions tagged [menuitem]

A menu item is a child element of a menu that provides the user a means to view and execute a specific application operation.

A menu item is a child element of a menu that provides the user a means to view and execute a specific application operation. A menu item may have an accelerator key which provides the user a quick way to execute the menu item operation. A menu item in turn can consist of other child menu items.

2533 questions
54
votes
9 answers

Is it possible to grey out (not just disable) a MenuItem in Android?

There's a question for the same functionality on Blackberry, and a few different threads referred to this bug (which has since been closed without resolution as far as I can tell), but I haven't found one specifically for Android. I'm calling…
Waynn Lue
  • 11,344
  • 8
  • 51
  • 76
50
votes
5 answers

How to add "active" class to wp_nav_menu() current menu item (simple way)

I am creating custom Wordpress theme using a starter theme _Underscores and Bootstrap. I would like to modify wp_nav_menu so that it assigns the current menu item .active class instead of the default .current-menu-item. I need this in order to use…
mzrnsh
  • 2,260
  • 2
  • 20
  • 25
48
votes
6 answers

Android Change Navigation Drawer Menu Items Text programmatically

I have the new Navigation Drawer in my app and I want to change the navigation view menu items title text dynamically from code. I have watched many posts but I can't figure out, how can I do this. How can I achieve this…
user3065901
  • 4,678
  • 11
  • 30
  • 52
47
votes
8 answers

Android adding a submenu to a menuItem, where is addSubMenu()?

I want to add a submenu inside my OptionsMenu to a menuItem, programatically according to my parameters. I've checked "MenuItem" in android sdk and there is no addSubMenu() method!, although you can find "hasSubMenu()" and "getSubMenu". Was…
ruhalde
  • 3,521
  • 3
  • 24
  • 28
47
votes
7 answers

Android ActionBar MenuItem LowerCase

I want to make MenuItem title in the ActionBar to LowerCase. my menu.xml
Vladimir
  • 549
  • 1
  • 5
  • 8
46
votes
18 answers

Mutually exclusive checkable menu items?

Given the following code:
TERACytE
  • 7,553
  • 13
  • 75
  • 111
45
votes
6 answers

How can I alter a MenuItem on the Options Menu on Android?

I have an Options Menu on my Activity with an MenuItem "Start". When this MenuItem is selected I would like to alter the Menu so it contains a MenuItem "Stop". And finally when "Stop" is selected, I would like to alter back to "Start". Here is parts…
Jonas
  • 121,568
  • 97
  • 310
  • 388
45
votes
9 answers

How to display menu item with icon and text in AppCompatActivity

I tried different combinations in xml file:
Yarh
  • 4,459
  • 5
  • 45
  • 95
43
votes
3 answers

What should I pass for root when inflating a layout to use for a MenuItem's ActionView?

I have an ImageView that I attach to a MenuItem as its ActionView (the item appears in the ActionBar). The layout for this view comes from XML. I'm inflating it like so: ImageView actionView = (ImageView) layoutInflater.inflate( …
dlf
  • 9,045
  • 4
  • 32
  • 58
40
votes
8 answers

WPF setting a MenuItem.Icon in code

I have an images folder with a png in it. I would like to set a MenuItem's icon to that png. How do I write this in procedural code?
ScottG
  • 10,711
  • 25
  • 82
  • 111
39
votes
5 answers

How to create a Menu instance programmatically? i.e. inflate a Menu outside onCreateOptionsMenu

I want to inflate a menu object outside onCreateOptionsMenu method (which means to create/show the menu when the user doesn't press the button), so I need to create a menu instance to pass it to the inflate method. Here is an example of what I am…
iTech
  • 18,192
  • 4
  • 57
  • 80
37
votes
5 answers

How to add line divider for menu item Android

My menu item become bigger so that I want group them and make a line divider to separate each group. What should I do now ?
mdtuyen
  • 4,470
  • 5
  • 28
  • 50
35
votes
2 answers

How to include a common menu item in multiple menus in Android menu xml?

Many of menus have always one item same to all. Is there the way to define that item as extra menu and include it to all other? Something like this: menu/main.xml
Tima
  • 12,765
  • 23
  • 82
  • 125
33
votes
10 answers

How to change Custom Font of Android Menu Item?

I have the following Android Java and XML code. I want to change the font of Menu Items of my app. I know only that we can change the font of TextView using setTypeface but not able to find anyway for Menu Item. JAVA Code-: @Override public boolean…
Anshuman Pattnaik
  • 883
  • 3
  • 16
  • 37
29
votes
1 answer

How do I dynamically bind and statically add MenuItems?

I'm binding the ItemsSource of my MenuItem to an ObservableCollection in my ViewModel. Here is my xaml: