menuitem

OnMenuItemSelected isn't called when layout is set for menu item

房东的猫 提交于 2019-12-18 04:33:52
问题 I have a menu which is inflated from main_menu.xml: <menu xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/act_sync" android:showAsAction="always" android:actionLayout="@layout/sync_action" android:icon="@android:drawable/ic_popup_sync" /> </menu> and here is the code in the activity: @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.main_menu, menu); return true; } @Override public boolean onOptionsItemSelected

ASP.NET MenuItem Individual Styles

北战南征 提交于 2019-12-17 19:34:55
问题 I'm hoping to use an ASP.NET Menu Control for navigation through my site. However, I've got a requirement that each MenuItem must be styled differently (different colors, both static, and onHover). Without creating a custom class that would inherit from MenuItem, is this possible? Thoughts on a better solution? 回答1: Short of overriding RenderContents on Menu, your options are very limited. Most of what you'd need is private and sealed and you won't get anywhere there. My solution would be to

MenuItem's checked state is not shown correctly by its icon

℡╲_俬逩灬. 提交于 2019-12-17 15:56:15
问题 I have MenuItem defined this way: <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/menu_starred" android:icon="@drawable/btn_star" android:title="@string/description_star" android:checkable="true" android:checked="true" android:orderInCategory="1" android:showAsAction="always" /> </menu> and btn_star.xml defined this way: <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state

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

霸气de小男生 提交于 2019-12-17 15:23:46
问题 I am creating custom Wordpress theme using a starter theme _Underscores. I am also using Bootstrap as a front-end framework. I would like to modify wp_nav_menu so that it assigns current menu item class="active" instead of class="current-menu-item" (which is default). Or maybe at least assigns both of these classes. I need this in order to use .active class from bootstrap.css. Here is the example of what I have (all these classes are wp generated, please scroll to see what I mean): <ul id=

How to style menu button and menu items

最后都变了- 提交于 2019-12-17 10:53:57
问题 I tried to change styles in menu button. I could change menu button style but not its menu item. No matter what i try menu item inside menu-button remains unchanged. .menu-button { -fx-background-color:black; } .menu-button .label { -fx-background-color:black; } Now how can i change color that is left out?? 回答1: MenuButton uses Menu internally and has a similar API. In such way that MenuButton contains MenuItem s list just like Menu . So I think you need to try to play with .menu , .menu

Menu item icon added programmatically is not displayed

匆匆过客 提交于 2019-12-17 10:04:34
问题 I have a display menu item icon issue when trying to add a checked image programmatically: private void ObjectsCanvas_MouseRightButtonDown(object sender, MouseButtonEventArgs e) { ContextMenu cm = new ContextMenu(); MenuItem mDiag = new MenuItem(); mDiag.Icon = new System.Windows.Controls.Image { Source = (new BitmapImage(new Uri("assets/checked-32-context.png", UriKind.Relative))) }; mDiag.Header = Application.Current.Resources["DiagScreenMenuText"].ToString(); cm.Items.Add(mDiag); cm

Can't resolve symbol MenuItemCompat

梦想的初衷 提交于 2019-12-14 04:22:20
问题 I get an error on using MenuItemCompat that the symbol cannot be resolved . Neither is there any option to import anything at all. I am new to android. I think there are some dependencies missing. I was trying to use getActionProvider() method to get Action Provider of a menu item. 回答1: If you are using Android Studio then configure the SDK Manager and download below libraries (present inside Extras directory) - 1. Android Support Repository 2. Android Support Library Then restart the Android

RelayCommand not firing on MenuItem click WPF MVVM

柔情痞子 提交于 2019-12-14 03:42:38
问题 I have menu item on my WPF form that runs a import routine, I have bound the command property to a ICommand property in my view model but for some reason the method won't fire. This is the xaml: <Menu Height="21" Margin="0,-2,0,0" VerticalAlignment="Top" Grid.ColumnSpan="2"> <MenuItem Header="File" Command="{Binding ImportFileCommand}">Import</MenuItem> </Menu> And this is in my view model: private ICommand importfilecommand; public ICommand ImportFileCommand { get { if (this

How to adding item menus with the java script of an loop's sub menus inside like this example “.addItem(”Go to This Sheet“, ”S“+i+”GoToS“)”?

淺唱寂寞╮ 提交于 2019-12-14 03:23:15
问题 Hy, Everyone .. I have a question about creating the menu in GAS (Google Apps Scripts) to implement to a Google Spreadsheet without a three of the scripts which is has been take long long way and take my energy too and many many so many lines of the scripts like this I have created. This is the script. Here's the code : function Menu1() { var ui = s.getUi(), s = SpreadsheetApp, ss = s.getAcgtiveSpreadsheet(), sss = ss.getSheets(), madeMenu = ui.createMenu('Sheet Tools Just For an Example

Adding and removing ToolStripMenuItem's from MenuStrip and DropDownItems in WinForms

久未见 提交于 2019-12-13 14:07:50
问题 I have MenuStrip with some static items. To this MenuStrip I am adding items programmatically. Some of these items has child items ( DropDownItems ). At some point I would like to remove all added items to recreate menu with different items. How to do it right? Example situation: mainMenu -staticItem1 -added1 -added1_sub1 -added1_sub2 -added2 -added2_sub1 I could do: added1.Dispose(); mainMenu.Items.Remove(added2); Both of this works, but I am not sure if it's safe. Maybe I should remove and