Questions tagged [menu]

A menu is a user interface mechanism that provides the user a means to view and execute application operations. (Generic; please use platform and/or language tags when possible instead)

Filter by
Sorted by
Tagged with
265 votes
15 answers
135k views

How to copy text programmatically in my Android app?

I'm building an Android app and I want to copy the text value of an EditText widget. It's possible for the user to press Menu+A then Menu+C to copy the value, but how would I do this programmatically?
Zach's user avatar
  • 24.7k
233 votes
13 answers
239k views

How to change menu item text dynamically in Android

I'm trying to change the title of a menu item from outside of the onOptionsItemSelected(MenuItem item) method. I already do the following; public boolean onOptionsItemSelected(MenuItem item) { try ...
Garbit's user avatar
  • 5,946
218 votes
13 answers
108k views

CSS: bolding some text without changing its container's size

I have a horizontal navigation menu, which is basically just a <ul> with the elements set side-by-side. I do not define width, but simply use padding, because I would like the widths to be ...
Mala's user avatar
  • 14.5k
207 votes
6 answers
163k views

Changing Locale within the app itself

My users can change the Locale within the app (they may want to keep their phone settings in English but read the content of my app in French, Dutch or any other language ...) Why is this working ...
Hubert's user avatar
  • 16.1k
184 votes
1 answer
219k views

XSLT getting last element

I am trying to find the last element in my xml, which looks like: <list> <element name="A" /> <element name="B" > <element name="C" /> ...
Nik's user avatar
  • 9,236
145 votes
4 answers
235k views

Android custom dropdown/popup menu

How do I do a custom dropdown/popup menu anchored to a button? I need it to work like the popup menu (anchored to a view), and do something when I click an item from the menu. How do I add items to ...
stanete's user avatar
  • 4,082
119 votes
4 answers
108k views

Android: create a popup that has multiple selection options

I've been searching around trying to figure out how to create a popup or a dialog that has 4 options to choose from. I see this picture on the Android developer site: Does anyone know how to code ...
Cornomaniac's user avatar
  • 1,193
109 votes
5 answers
76k views

<nav> or <menu> (HTML5)

W3Schools.com and I'm pretty sure I remember seeing W3C.org state that <menu> should be used for Toolbar menus and listing form control commands. So, which one should I use for my main menu? ...
user avatar
106 votes
14 answers
457k views

How to get selected value of a dropdown menu in ReactJS

I'm using react and I want to get the value of the selected option of a dropdown in react but I don't know how. Any suggestions? thanks! My dropdown is just a select like: <select id = "dropdown"&...
BlueElixir's user avatar
  • 3,369
101 votes
18 answers
128k views

Changing text color of menu item in navigation drawer

I'm trying to add a night theme for my app and I've wasted nearly three hours just trying to make the text and icons in my navigation drawer turn white along with the dark background. Here is the way ...
wasimsandhu's user avatar
  • 4,446
100 votes
10 answers
42k views

'setHasOptionsMenu(Boolean): Unit' is deprecated. Deprecated in Java

How do I declare a menu inside of Android fragment? The method that I had used previously is now deprecated. Originally: override fun onCreateView(...): View { setHasOptionsMenu(true) }...
SUR4IDE's user avatar
  • 1,193
96 votes
6 answers
109k views

How to update a menu item shown in the ActionBar?

I have an Activity that has 2 fragments. Both are ListFragments and both contribute MenuItems to the Menu. I have one MenuItem that I've set the attribute android:showAsAction to have it show as a ...
brockoli's user avatar
  • 4,566
92 votes
13 answers
157k views

How can I make content appear beneath a fixed DIV element?

My intention is to create a menu at the top of the page which remains at the top of the page even when the user scrolls (like Gmail's recent feature which has the commonly-used buttons scrolling down ...
Mus's user avatar
  • 7,430
88 votes
7 answers
221k views

What is the hamburger menu icon called and the three vertical dots icon called? [closed]

Google and some other developers have introduced us to what some have called the hamburger menu button and now the 3 vertical dots button or vertical ellipsis. What is the official name of these ...
Jeff Baker's user avatar
  • 1,492
85 votes
18 answers
403k views

How to make the HTML link activated by clicking on the <li>?

I have the following markup, <ul id="menu"> <li><a href="#">Something1</a></li> <li><a href="#">Something2</a></li> <...
San's user avatar
  • 2,326
77 votes
2 answers
32k views

Place a dividing line in a menu in WPF

In XAML, how do I put a standard dividing line in a menu? eg <MenuItem Header="_File" Name="m_fileMenu"> <MenuItem Header="_Open" Command="ApplicationCommands.Open"/> <!-- ...
Andrew Shepherd's user avatar
76 votes
3 answers
21k views

Android invalidateOptionsMenu() for API < 11

I used ActivityCompat.invalidateOptionsMenu(MainActivity.this); so that my menu item "refresh" can automatically be enabled/disabled without the using have to touch the "Menu" option (imagine the ...
SnitramSD's user avatar
  • 1,169
71 votes
7 answers
105k views

creating a menu after a long click event on a list view

I have a list view connected to a database, showing a all the entries. I want a menu to show up if the user long clicks a item in the listview(database entry), showing options to edit or delete the ...
Eriz's user avatar
  • 972
70 votes
6 answers
92k views

Android : Get view Reference to a Menu Item

I plan to use quick actions UI pattern in my application. Android Quick Actions UI Pattern . The quick action window needs a pivot view to stick to. quickAction.show(View pivotView); I intend ...
Yashwanth Kumar's user avatar
65 votes
5 answers
25k views

active menu item - asp.net mvc3 master page

I've been scanning around trying to find an appropriate solution for assigning "active/current" class to menu items from the master page. The line is split down the middle with regards of whether to ...
Michael's user avatar
  • 742
64 votes
11 answers
31k views

Searchview doesn't work since app compat

Since I implented app compat my searchview doesn't work anymore: Process: com.laurenswuyts.witpa, PID: 26666 java.lang.NullPointerException: Attempt to invoke virtual method 'void android....
Laurenswuyts's user avatar
  • 2,144
64 votes
5 answers
31k views

Differences between .ContextMenu and .ContextMenuStrip

What are the differences between .ContextMenu and .ContextMenuStrip in Windows Forms? I already know what a ContextMenu is, but how is ContextMenuStrip different from ContextMenu?
user avatar
63 votes
10 answers
82k views

How can I refresh the ActionBar when onPrepareOptionsMenu switched menu entries?

Within my apps I often enable/disable menu entries and do make them visible from onPrepareOptionsMenu. Today I started to add the android:showAsAction menu attribute to some of my Android 2.x apps to ...
Harald Wilhelm's user avatar
62 votes
3 answers
54k views

Get rid of -webkit-padding-start: 40px

I am working on adding a menu to a map. The menu is working fine except I noticed there is always a padding to the left no matter what CSS applied to the menu. The padding seems to be originated from (...
user avatar
59 votes
6 answers
64k views

Android Create a simple menu programmatically

I'm trying to create a simple menu with one button that will call a method to clear the array. I don't want to use xml because all I need is one button. Something like this - public boolean ...
Shmuel's user avatar
  • 3,916
59 votes
5 answers
25k views

When to use ellipsis after menu items

In pretty much all applications that have a menu bar, some of the items have an ellipsis (...) after them, and some don't. Is there a well known convention on when to put that ellipsis there and when ...
Svish's user avatar
  • 155k
58 votes
16 answers
152k views

Twitter Bootstrap add active class to li

Using twitter bootstrap, and I need to initiate active class to the li portion of the main nav. Automagically. We use php not ruby. Sample nav : <ul class="nav"> <li><a href="/"&...
422's user avatar
  • 5,764
57 votes
11 answers
57k views

How to open the options menu programmatically?

I would like to open the optionsMenu programmatically without a click on the menu key from the user. How would I do that?
BlaBRA's user avatar
  • 2,211
56 votes
3 answers
103k views

WPF menu item with image

How to define MenuItem.Icon so that the MenuItemHeader text would be placed below the menu item image?Thanks for help!
Vytas's user avatar
  • 1,271
56 votes
5 answers
188k views

Adding a right click menu to an item

I have been searching for a while for a simple right-click menu for a single item. For example if I right-click on a picture I want a little menu to come up with my own labels: Add, Remove etc. If ...
Marshal's user avatar
  • 1,217
56 votes
4 answers
76k views

How to connect menu click with action in Qt Creator?

I am completely new to Qt. I started with a new Qt4 GUI Application. Using the designer, I have created a menu like so: File - Exit How do I get an action associated with the menu item? I found ...
Nathan Osman's user avatar
  • 72.3k
55 votes
9 answers
40k views

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 ...
Waynn Lue's user avatar
  • 11.4k
54 votes
2 answers
30k views

A vertical Separator control in a Menu, Toolbar, StackPanel, etc. - Is it possible?

I want to use the Separator control in a vertical way (Lets say in a horizontal StackPanel). Searching around I found this method but it doesn't use the Separator control rather it uses borders and ...
Randall Flagg's user avatar
54 votes
2 answers
58k views

How to change Options menu dots color? [duplicate]

I want to change Options menu's dots color to white. I tried to add image for this but dose not work. How to do this? menu xml : <menu xmlns:android="http://schemas.android.com/apk/res/...
Sid's user avatar
  • 2,840
53 votes
11 answers
146k views

Call method when home button pressed

I have this method in one of my Android Activities: @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if(keyCode == KeyEvent.KEYCODE_BACK) { Log.d("Test", "Back button ...
ingh.am's user avatar
  • 26.3k
49 votes
8 answers
90k views

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 ...
ruhalde's user avatar
  • 3,541
48 votes
6 answers
77k views

How can I get the options menu of my Activity?

In some methods of my Activity I want to check the title of menu or know if it is checked or not. How can I get Activity's menu. I need something like this.getMenu()
Bob's user avatar
  • 22.9k
48 votes
6 answers
75k views

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. ...
user3065901's user avatar
  • 4,738
47 votes
2 answers
164k views

Drop-down menu that opens up/upward with pure css

I've created a dropdown menu with pure CSS and I've gotten it to a place that I like except I want it to be "drop-up" not "drop-down" since the menu bar is going at the bottom of the layout. What I ...
greysuit's user avatar
  • 473
46 votes
11 answers
112k views

How to make jQuery UI nav menu horizontal?

I love the jQuery UI stuff! I like the navigation menu, but I can't seem to get it horizontal. I've got to be missing something that's a cinch. Anyone know how to change the CSS? I tried this but it ...
SQLiteNoob's user avatar
  • 3,004
45 votes
25 answers
149k views

Add Active Navigation Class Based on URL

I'm trying to add an active class (i.e. class="active") to the appropriate menu list item based upon the page it is on once the page loads. Below is my menu as it stands right now. I've tried every ...
slybitz's user avatar
  • 689
45 votes
4 answers
185k views

How to make a HTML list appear horizontally instead of vertically using CSS only?

I need this because I want to make a menu (which is made from a HTML list) appear horizontally. I prefer not to use absolute positioning since it might become messy when I start changing the layout ...
M. A. Kishawy's user avatar
45 votes
6 answers
109k views

How do I generate a custom menu/sub-menu system using wp_get_nav_menu_items in WordPress?

I have an html structure that requires customization of the wp_nav_menu code. This is the html I need to generate: <ul class="main-nav"> <li class="item"> <a href="http://...
hitautodestruct's user avatar
43 votes
6 answers
33k views

Android: Programmatically detect if device has hardware menu button

I'm currently struggling with this issue. I need to check if the device, where the app is installed, has a hardware menu key. Because it is not existing on some devices like Galaxy Nexus, I'm showing ...
NiThDi's user avatar
  • 1,017
42 votes
5 answers
23k views

What is a WAI-ARIA compliant implementation for navigation bar/menu

We are in the process of implementing (i.e. adding) WAI-ARIA support to the main navigation menu of a web portal. Menu is the one shown here: Menu is implemented by means of classic <ul> / <...
superjos's user avatar
  • 12.4k
40 votes
13 answers
99k views

How to change background color popup menu android

I generate each option of menu from querying database. Here is my code. final PopupMenu popupMenu = new PopupMenu(getBaseContext(), v); SQLiteDatabase db = AdapterDb.getReadableDatabase(); Cursor ...
user3172337's user avatar
40 votes
1 answer
18k views

Android MenuItemCompat.getActionView is Deprecated

I am implementing a SearchView like this: MenuItem search = menu.findItem(R.id.search); SearchView searchView = (SearchView) MenuItemCompat.getActionView(search); But this gives me an inspection ...
Kartik Shandilya's user avatar
39 votes
5 answers
27k views

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 ...
iTech's user avatar
  • 18.4k
37 votes
5 answers
42k views

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 ? <menu xmlns:android="http://schemas.android.com/apk/res/android" ...
mdtuyen's user avatar
  • 4,480
37 votes
2 answers
40k views

Dynamic nested Material menu from json object in Angular 5

How to create dynamic nested menu from json object? I started using Angular Material Design today for the first time and I'm trying to create nested menus using material design. The documentation is ...
rain01's user avatar
  • 1,214

1
2 3 4 5
318