menuitem

change MenuItem visibility when clicked

六眼飞鱼酱① 提交于 2019-12-01 21:25:09
问题 I'm trying to hide one MenuItem and make another visible when the first is selected. The ID's for each are: pencil: R.id.button_routines_edit check mark: R.id.button_routines_edit_done Here the relevant code: private boolean isEditing = false; @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle item selection switch (item.getItemId()) { case R.id.button_routines_edit: // hide pencil icon, show checkmark isEditing = true; return true; case R.id.button_routines_edit_done:

Underline menu item in navigation drawer list

筅森魡賤 提交于 2019-12-01 20:25:15
How do you underline menu items in navigation drawer? expectation : reality : @menu/activity_navigation_drawer: <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android"> <group android:checkableBehavior="single"> <item android:id="@+id/nav_open_account" android:title="@string/na_navigate_open_account" /> <item android:id="@+id/nav_login" android:title="@string/na_navigate_login" /> <item android:id="@+id/nav_stock_signals" android:title="@string/na_navigate_stock_signals" /> ... </group> navigation drawer activity layout: <?xml version="1.0"

Android support:design NavigationView checked menu sub items

。_饼干妹妹 提交于 2019-12-01 17:23:13
I have recently started converting my android app to use the latest support library called support:design. While implementing the new NavigationView i've stumbled upon a problem displaying the selected menu items. My navdrawer_menu.xml <menu xmlns:android="http://schemas.android.com/apk/res/android"> <group android:checkableBehavior="single"> <item android:id="@+id/navigation_item_home" android:icon="@drawable/ic_home_black" android:title="@string/navdrawer_item_home" /> </group> <item android:id="@+id/navigation_subheader" android:title="@string/navdrawer_subheader_title1"> <menu> <group

Android support:design NavigationView checked menu sub items

空扰寡人 提交于 2019-12-01 16:57:47
问题 I have recently started converting my android app to use the latest support library called support:design. While implementing the new NavigationView i've stumbled upon a problem displaying the selected menu items. My navdrawer_menu.xml <menu xmlns:android="http://schemas.android.com/apk/res/android"> <group android:checkableBehavior="single"> <item android:id="@+id/navigation_item_home" android:icon="@drawable/ic_home_black" android:title="@string/navdrawer_item_home" /> </group> <item

How to show menu item with icon AND text in WinForms system menu

本小妞迷上赌 提交于 2019-12-01 11:16:08
While adapting the answer of ygoe , I discovered that it's possible to add an icon to the menu. I tried and succeeded in doing so by using this code for a text-only item: var item = new MenuItemInfo { cbSize = (uint)Marshal.SizeOf(typeof(MenuItemInfo)), cch = (uint)label.Length, dwTypeData = label, fMask = 0x2 | 0x10, // MIIM_ID | MIIM_TYPE fState = 0x0, // MFS_ENABLED fType = 0x0, // MFT_STRING wID = id }; InsertMenuItem(hMenu, 0, true, ref item); For an icon-based item, I changed fMask and added hbmpItem like this: var item = new MenuItemInfo { cbSize = (uint)Marshal.SizeOf(typeof

asp:MenuItem / CSS

狂风中的少年 提交于 2019-12-01 09:45:38
问题 I have an asp menu, with only 1 (top) level of menu items. Each of the menu items needs to have a different way to be recognized by CSS (for unique hover, etc.). I'm trying to avoid a javascript solution. Currently I can find no way with just asp and CSS to control individual menu items. Any help would be appreciated! <asp:Menu ID="NavigationMenu" runat="server" CssClass="menu" EnableViewState="false" IncludeStyleBlock="false" Orientation="Horizontal"> <Items> <asp:MenuItem NavigateUrl="~

How to change toolbar menu item text color for pre Lollipop and Lollipop versions

六眼飞鱼酱① 提交于 2019-12-01 08:51:58
问题 I am using Toolbar for the purpose of material design in my application. Everything working fine but except when it comes to change the menu item text color I am completely stuck up with the solution. I am also posting screenshot of the text that should be taken and code I am using in my application for your reference. I tried several alternate methods like assigning as follows <item name="android:actionMenuTextColor">@color/white</item> <item name="android:textColor">#000</item> But known of

How to make access-text-underscores always visible in menu items?

筅森魡賤 提交于 2019-12-01 07:34:16
问题 Normally the underscores for access texts are only visible when a menu has been accessed via keyboard input (e.g. the top menu via Alt or a context-menu via the menu key). I would like to add an option to an application to make them always visible to make it easier to use mouse and keyboard in combination (mouse to point and open a specific context menu, keyboard to execute a certain item on that menu). Possibly there is a simple way of doing this, possibly not, at the very least it does not

How to show menu item with icon AND text in WinForms system menu

孤者浪人 提交于 2019-12-01 07:26:57
问题 While adapting the answer of ygoe, I discovered that it's possible to add an icon to the menu. I tried and succeeded in doing so by using this code for a text-only item: var item = new MenuItemInfo { cbSize = (uint)Marshal.SizeOf(typeof(MenuItemInfo)), cch = (uint)label.Length, dwTypeData = label, fMask = 0x2 | 0x10, // MIIM_ID | MIIM_TYPE fState = 0x0, // MFS_ENABLED fType = 0x0, // MFT_STRING wID = id }; InsertMenuItem(hMenu, 0, true, ref item); For an icon-based item, I changed fMask and

I am unable to set a submenu item as checked

杀马特。学长 韩版系。学妹 提交于 2019-12-01 07:16:55
I am using a NavigationView for my drawer. This is the menus.xml file which defines all the menu items for the drawer: <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android"> <group android:checkableBehavior="single"> <item android:id="@+id/item_1" android:title="Item 1" android:checked="true" /> <item android:id="@+id/item_2" android:title="Item 2" /> <item android:id="@+id/item_3" android:title="Item 3" /> <item android:id="@+id/item_4" android:title="Item 4" /> <item android:title="List 1"> <menu> <item android:id="@+id/subitem_1" android