menuitem

How do I center align horizontal <UL> menu?

主宰稳场 提交于 2019-11-26 05:48:26
问题 I need to center align a horizontal menu. I\'ve tried various solutions, including the mix of inline-block / block / center-align etc., but haven\'t succeeded. Here is my code: <div class=\"topmenu-design\"> <!-- Top menu content: START --> <ul id=\"topmenu firstlevel\"> <li class=\"firstli\" id=\"node_id_64\"><div><a href=\"#\"><span>Om kampanjen</span></a></div></li> <li id=\"node_id_65\"><div><a href=\"#\"><span>Fakta om inneklima</span></a></div></li> <li class=\"lastli\" id=\"node_id_66\

Sql Server &#39;Saving changes is not permitted&#39; error ► Prevent saving changes that require table re-creation

此生再无相见时 提交于 2019-11-26 04:57:06
问题 When I create a table in SQL Server and save it, if I try to edit the table design, like change a column type from int to real, I get this error: Saving changes is not permitted. The change you have made requires the following table to be dropped and re-created. You have either made changes to a table that can\'t be recreated or enabled the option prevent saving changes that require the table to be re-created. Why do I have to re-create the table? I just want to change a data type from

Handling a Menu Item Click Event - Android

孤人 提交于 2019-11-26 04:11:40
问题 I want to create an intent that starts a new activity once a Menu Item is clicked, but I\'m not sure how to do this. I\'ve been reading through the android documentation, but my implementation isn\'t correct..and some guidance in the right direction would help. I\'ve listed my code below and commented out my problem areas, I think I\'m invoking the wrong method. package com.jbsoft.SimpleFlashlight; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import

How to change menu item text dynamically in Android

耗尽温柔 提交于 2019-11-26 03:37:07
问题 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 { switch(item.getItemId()) { case R.id.bedSwitch: if(item.getTitle().equals(\"Set to \'In bed\'\")) { item.setTitle(\"Set to \'Out of bed\'\"); inBed = false; } else { item.setTitle(\"Set to \'In bed\'\"); inBed = true; } break; } } catch(Exception e) { Log.i(\"Sleep Recorder\", e.toString()); }

How do I hide a menu item in the actionbar?

夙愿已清 提交于 2019-11-26 03:25:11
问题 I have an action bar with a menuitem. How can I hide/show that menu item? This is what I\'m trying to do: MenuItem item = (MenuItem) findViewById(R.id.addAction); item.setVisible(false); this.invalidateOptionsMenu(); 回答1: Get a MenuItem pointing to such item, call setVisible on it to adjust its visibility and then call invalidateOptionsMenu() on your activity so the ActionBar menu is adjusted accordingly. Update: A MenuItem is not a regular view that's part of your layout. Its something

How do I hide a menu item in the actionbar?

橙三吉。 提交于 2019-11-26 02:48:44
I have an action bar with a menuitem. How can I hide/show that menu item? This is what I'm trying to do: MenuItem item = (MenuItem) findViewById(R.id.addAction); item.setVisible(false); this.invalidateOptionsMenu(); K-ballo Get a MenuItem pointing to such item, call setVisible on it to adjust its visibility and then call invalidateOptionsMenu() on your activity so the ActionBar menu is adjusted accordingly. Update: A MenuItem is not a regular view that's part of your layout. Its something special, completely different. Your code returns null for item and that's causing the crash. What you need

How to change the Text color of Menu item in Android?

假如想象 提交于 2019-11-26 02:17:11
问题 Can I change the background color of a Menu item in Android? Please let me know if anyone have any solution to this. The last option will be obviously to customize it but is there any way for changing the text color without customizing it. 回答1: One simple line in your theme :) <item name="android:actionMenuTextColor">@color/your_color</item> 回答2: It seems that an <item name="android:itemTextAppearance">@style/myCustomMenuTextAppearance</item> in my theme and <style name=

Android 4.3 menu item showAsAction=“always” ignored

谁都会走 提交于 2019-11-26 01:56:54
问题 I\'m using the new v7 appcompat library available starting from Android 4.3 (API level 18). Regardless of what is specified in showAsAction for a menu item, it\'s not shown - it always creates the overflow menu icon, and puts even a single menu item under the menu. Trying to add menu to an activity like this: @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.menu_sizes, menu); return true; } And here\'s my menu xml: <menu xmlns:android=\"http://schemas