menuitem

How to Implement dynamic routing in routes.js for generated menu items in sidebar in universal react redux boilerplate by erikras

给你一囗甜甜゛ 提交于 2019-11-27 05:34:42
问题 I am currently working on a CMS based project. For which i am using the universal react redux boilerplate by erikras I really need suggestions on handling dynamic routing Lets take a simple scenario form the boilerplate... In routes.js <Route path="about" component={About}/> <Route path="login" component={Login}/> <Route path="survey" component={Survey}/> <Route path="widgets" component={Widgets}/> data.js export const data = [ {id: 1, property: 'Dashboard', link: '/'}, {id: 2, property:

How to change Custom Font of Android Menu Item?

蓝咒 提交于 2019-11-27 04:22:11
问题 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 onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.main, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.action_refresh1:

Change Menu Items Programmatically From Eclipse Plugin

老子叫甜甜 提交于 2019-11-27 04:20:00
问题 I would like to be able to completely remove menu items upon startup of my eclipse plugin application. What I want to do is be able to add these menu items later depending on business logic based off of the user's actions. Is there a way to do this? I've looked at using contributions, but I feel like it's not going to be exactly what I want. If it can do what I need it to do, how do I go about using them? Thanks in advance for any assistance. 回答1: You can obtain the Menu from the MenuManager

Navigation Drawer Menu Item Title Color in Android

耗尽温柔 提交于 2019-11-27 01:51:23
问题 I have a problem changing the Menu Item Title Color in the Navigation Drawer I set the itemTextColor but it only changes the Color of the Items not the Title of the menu. Here is my Activity_main.xml <?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.DrawerLayout 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" android:id="@+id/drawer_layout" android:layout_width="match

How to display menu item with icon and text in AppCompatActivity

烈酒焚心 提交于 2019-11-27 01:41:15
I tried different combinations in xml file: <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" tools:context=".MainActivity"> <item android:id="@+id/action_create_alarm" android:icon="@drawable/ic_action_accept" android:orderInCategory="100" android:title="@string/menu_create_alarm" app:showAsAction="ifRoom|withText" /> </menu> or <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android

Is there a standard way to add dividers between action bar items in Android 3.0?

走远了吗. 提交于 2019-11-27 01:23:36
问题 I have a slight problem trying to customise the look of the action bar in my app. I want to be able to have the pixel wide dividers to group action bar items that you see in many of the native apps (e.g. Gmail, Calendar). I found a way to do this by adding a menu item and setting the 'android:actionLayout' attribute to a custom layout for the divider: <View android:background="@color/LightGray" android:layout_marginTop="5dip" android:layout_marginBottom="5dip" android:layout_width="1dip"

WPF setting a MenuItem.Icon in code

Deadly 提交于 2019-11-27 00:53:02
问题 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? 回答1: menutItem.Icon = new System.Windows.Controls.Image { Source = new BitmapImage(new Uri("images/sample.png", UriKind.Relative)) }; 回答2: <MenuItem> <MenuItem.Icon> <Image> <Image.Source> <BitmapImage UriSource="/your_assembly;component/your_path_here/Image.png" /> </Image.Source> </Image> </MenuItem.Icon> </MenuItem> Just make sure your image in also included

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

大兔子大兔子 提交于 2019-11-27 00:42:13
问题 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 of my code that isn't working. I have both "Start" and "Stop" listed in mymenu.xml I should probably remove "stop" when the menu is created: public class MyActivity extends Activity { private boolean isStarted = false; @Override public boolean

How to add submenu items to ActionBar action in code?

青春壹個敷衍的年華 提交于 2019-11-26 22:19:34
问题 Via xml I can add submenu items to my action in the ActionBar . main_menu.xml: <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/menu_new_form" android:icon="@drawable/ic_new_form" android:title="@string/menu_new_form" android:showAsAction="ifRoom|withText"> <menu> <item android:id="@+id/form1" android:icon="@drawable/attachment" android:title="Form 1" android:onClick="onSort" /> <item android:id="@+id/form2"

Android MenuItem Toggle Button

孤街浪徒 提交于 2019-11-26 21:21:10
问题 In my Android application, I want a setting to be toggleable in it's menu like the Dialer app does for speaker and mute. You can see a picture below: http://www.isaacwaller.com/images/acall.png You see how the Speaker, Mute and Hold options are toggle buttons - you can tap them again and they will toggle the green color. They may do this in a custom way, but I suspect it is a option (I tried setting the Checkable attribute). 回答1: It's looks like this menu item is implemented as a custom view.