android-actionbar

Contextual Actionbar styles

こ雲淡風輕ζ 提交于 2019-12-17 06:27:16
问题 I'm looking for style information on the Contextual Action bar (CAB). I just need to change the colour of the text in fact.. As you can see from the above, this is using the standard Theme.Holo.Light.DarkActionBar theme, so I just need to set the text colour to white! Can anyone point me in the right direction? 回答1: To change the color/etc of the text in a contextual action bar: public boolean onCreateActionMode(ActionMode mode, Menu menu) { //mode.setTitle("Contextual Action Bar"); (replace

android 4.0, text on the action bar NEVER shows

最后都变了- 提交于 2019-12-17 06:26:38
问题 I am trying to use the new api's from google, specifically the action bar. When the build was set at api 10, if I pressed the menu button, I got nice looking menu options, each with a picture and icon. When using api 14, No matter what I try, it always puts the icon in the action bar with NO text. I have tried everything I can think of. I gave it the "with text" property, changed the text to a single character (in case it was a room issue), but nothing. I have seen this done before, even in

android 4.0, text on the action bar NEVER shows

社会主义新天地 提交于 2019-12-17 06:26:05
问题 I am trying to use the new api's from google, specifically the action bar. When the build was set at api 10, if I pressed the menu button, I got nice looking menu options, each with a picture and icon. When using api 14, No matter what I try, it always puts the icon in the action bar with NO text. I have tried everything I can think of. I gave it the "with text" property, changed the text to a single character (in case it was a room issue), but nothing. I have seen this done before, even in

Remove application icon and title from Honeycomb action bar

隐身守侯 提交于 2019-12-17 04:45:30
问题 How can I remove the application icon & title which comes by default in an action bar? There is a similar question here: Can i hide the App Icon from the Action Bar in Honeycomb?, but it doesn't talk about how to do it? 回答1: Call setDisplayShowHomeEnabled() and setDisplayShowTitleEnabled() on ActionBar , which you get via a call to getActionBar() . 回答2: If you want to do it the XML way, then define a style (XML file) in the /res/values-v11/ folder with the following contents: <?xml version="1

Android Split Action Bar with Action Items on the top and bottom?

浪子不回头ぞ 提交于 2019-12-17 04:45:25
问题 Is there a way to specify some action items to the top part of the Split Action Bar while the others go to the bottom? Or is it all or nothing, whereby all the action items go to the bottom part of the split only? 回答1: This is currently not possible. See the response directly from Android developers Reto Meier and Roman Nurik during the Android Developer Office Hours: http://youtu.be/pBmRCBP56-Q?t=55m50s 回答2: To solve this I used a custom view as my action bar: @Override protected void

android:actionBarStyle requires API level 11

百般思念 提交于 2019-12-17 04:12:55
问题 While using the ActionBarSherlock in xml at: <item name="android:actionBarStyle">@style/Widget.Styled.ActionBar</item> I got this error: android:actionBarStyle requires API level 11 (current min is 8) error I'm using it for back porting my app with actionbar to 2.2 devices. How to use them both together: <item name="actionBarStyle">@style/Widget.Styled.ActionBar</item> <item name="android:actionBarStyle">@style/Widget.Styled.ActionBar</item> 回答1: You have to use only : <item name=

Returning from an activity using navigateUpFromSameTask()

拟墨画扇 提交于 2019-12-17 03:47:43
问题 I have two activities, A and B. When activity A is first started, it accesses the Intent passed to it (because the Bundle is null , as it should be the first time through), and displays information accordingly: CustInfo m_custInfo; ... protected void onCreate(Bundle savedInstanceState) { ... Bundle bundle = (savedInstanceState == null) ? getIntent().getExtras() : savedInstanceState; m_custInfo = (CustInfo) m_bundle.getSerializable("CustInfo"); if (m_custInfo != null ... } This works fine the

actionbar up navigation with fragments

你说的曾经没有我的故事 提交于 2019-12-17 03:46:12
问题 I have a tabbed Actionbar/viewpager layout with three tabs say A , B , and C . In tab C tab(fragment),I am adding another fragment say fragment D . with DFragment f= new DFragment(); ft.add(android.R.id.content, f, ""); ft.remove(CFragment.this); ft.addToBackStack(null); ft.commit(); I modify actionbar in DFragment's onResume to add up button: ActionBar ab = getActivity().getActionBar(); ab.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD); ab.setDisplayHomeAsUpEnabled(true); ab

How to set custom ActionBar color / style?

眉间皱痕 提交于 2019-12-17 03:24:06
问题 I am using Android Navigation bar in my project, I want to change the top color in action bar to something red, How can i do that? I have something like this, and i want something like this, how can i achieve that? 回答1: You can define the color of the ActionBar (and other stuff) by creating a custom Style : Simply edit the res/values/styles.xml file of your Android project. For example like this: <resources> <style name="MyCustomTheme" parent="@android:style/Theme.Holo.Light"> <item name=

Changing overflow icon in the action bar

纵饮孤独 提交于 2019-12-17 03:22:25
问题 Is it possible to change the overflow icon in the action bar? I have blue icons for all ActionBar items and I also want to change the overflow icon when it appears. 回答1: You can with a style, but you have to add it to the main Theme declaration. <resources> <!-- Base application theme. --> <style name="Your.Theme" parent="@android:style/Theme.Holo"> <!-- Pointer to Overflow style ***MUST*** go here or it will not work --> <item name="android:actionOverflowButtonStyle">@style/OverFlow</item> <