menuitem

Menu item click hides popup

你。 提交于 2019-12-11 03:46:31
问题 I have list of items with checkboxes in my menu: <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" tools:context=".ListActivity"> <group android:checkableBehavior="all" android:orderInCategory="1"> <item android:id="@+id/all" android:checkable="true" android:checked="true" android:icon="@android:drawable/ic_menu_preferences" android:title="@string/category_all" /> <item android:id="@+id/entertainment" android:checkable="true"

Android custom action bar with action buttons

血红的双手。 提交于 2019-12-11 03:16:45
问题 Here is the action bar that I want to create. Here is items that I put in menu. <item android:id="@+id/search" android:title="Search" android:showAsAction="ifRoom|collapseActionView" android:actionLayout="@layout/search_layout" /> <item android:id="@+id/search1" android:title="PHOTO" android:showAsAction="ifRoom" android:actionLayout="@layout/search_layout" /> collapseActionView - collapses search menu on startup. After click on search item it shows edit text like on picture 1. But I need

Change Android Action Bar Menu Item's Icon on Click

你离开我真会死。 提交于 2019-12-11 02:36:56
问题 I'm using sherlock action bar. I have 2 items on the action bar. When the item is chosen (active), I want to change the icon's image. This is my code on Java @Override public boolean onPrepareOptionsMenu (Menu menu){ MenuInflater inflater = getSupportMenuInflater(); inflater.inflate(R.menu.menutes, menu); todaySched=menu.findItem(R.id.todaySched); if(todaySched.isEnabled()){ todaySched.setIcon(R.drawable.calendarselected); } return true; } but when I do this the icon become double, and the

GWT MenuItem loses focus after selection

自闭症网瘾萝莉.ら 提交于 2019-12-11 01:18:02
问题 I have a simple vertical one-dimensional menu. Menu items are not fix, they change dynamically according to data received from the server. (So I cannot write fix code for them.) In css I declared selected MenuItem to be bold. My wish is simply to make the selected MenuItem remain bold after selection. But when I click it, it loses focus and the first MenuItem becomes bold. How could that be fixed? 来源: https://stackoverflow.com/questions/14455796/gwt-menuitem-loses-focus-after-selection

menuitem and contextmenu crossbrowser compatibility

社会主义新天地 提交于 2019-12-10 23:29:06
问题 Problem 1: I had made my own contextmenu using the following piece of code. function addFullScreenMenu () { var menu = document.createElement('menu'); var item = document.createElement('menuitem'); menu.setAttribute('id', 'fsmenu'); menu.setAttribute('type', 'context'); item.setAttribute('label', 'Fullscreen'); item.addEventListener('click', function (e) { if (window.fullScreen) { document.body.mozCancelFullScreen(); } else { document.body.mozRequestFullScreen(); } }); menu.appendChild(item);

MenuItemCompat.getActionView Returns Null

元气小坏坏 提交于 2019-12-10 22:06:34
问题 I am trying to implement a custom layout for my menu item and went through many solutions by I am getting Null pointer Exception whenever i try to fetch TextView inside the layout specified for actionLayout for my menuItem as the getActionView returns null. home_menu: <?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"> <item android:id="@+id/action_notifications" android:title="" app

How can I disable and gray the top level menu item using MFC

大兔子大兔子 提交于 2019-12-10 17:08:32
问题 I have a dialog application in which I want to have clickable menu items at the top of the dialog. These items do not show a drop down menu but actually run the associated commands. I did this by setting Popup=False in the dialogs properties and assigning a message-id but my problem is not having the ability to disable the item properly when it makes no sense for the item to be clickable (depending on internal state stored in the dialog) I have already found out how to disable any popup

Menu icon is not displaying in action bar

丶灬走出姿态 提交于 2019-12-10 13:18:50
问题 I need to inflate custom menu in Fragment. I have only one menu item.But the icon is not displaying. Can someone tell what is wrong with my code My menu.xml <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" > <item android:id="@+id/search" android:icon="@android:drawable/ic_search_category_default" app:showAsAction="always" android:title="Search"/></menu> And I set in onCreateView

Can't bind command from Menu Item to a Command Binding

淺唱寂寞╮ 提交于 2019-12-10 11:58:50
问题 I've got the following xaml: <Window x:Class="Isolator.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Isolator" Height="394" Width="486" Background="Black" WindowStyle="None" WindowState="Maximized"> <Window.CommandBindings> <CommandBinding Command="Close" Executed="CommandBinding_Executed" CanExecute="CommandBinding_CanExecute"/> </Window.CommandBindings> <Window.ContextMenu> <ContextMenu> <MenuItem

Change menu background color on android 2.3

徘徊边缘 提交于 2019-12-10 11:54:44
问题 How could I change menu background color? I try this but it is not work for me: <style name="MyTheme" parent="@android:style/Theme" > <item name="android:itemBackground">@drawable/menuitem_background</item> </style> Could you help me? Also I use this : protected void setMenuBackground(){ getLayoutInflater().setFactory( new Factory() { @Override public View onCreateView ( String name, Context context, AttributeSet attrs ) { if ( name.equalsIgnoreCase( "com.android.internal.view.menu