android-actionbar

withText in split ActionBar

五迷三道 提交于 2019-12-30 11:07:47
问题 I'm having an issue where if the ActionItem has both an icon and text and the ActionBar is split, it will only show the icon even if the showAsAction="always|withText" . Is there a way to force the text to appear? 回答1: withText is a hint to the system. On width-constrained devices or configurations the system may choose to ignore it. 回答2: I had the same problem recently and as already answered by adamp, there is no way to force the text to appear with the "withText" option. Actually this can

Add a shadow on ActionBar

元气小坏坏 提交于 2019-12-30 11:04:40
问题 I am trying to add a shadow under the title of the ActionBar. I have tried putting the attributes <item name="android:textColor">@color/white</item> <item name="android:shadowRadius">1</item> <item name="android:shadowColor">@color/black</item> <item name="android:shadowDy">1</item> but while textColor is working, the shadow isn't. I am using ActionBarSherlock 3.5 but I think it would not work on native either. Thanks 回答1: I can't get this to work either on native or ABS backport. Using the

Add a shadow on ActionBar

人盡茶涼 提交于 2019-12-30 11:04:23
问题 I am trying to add a shadow under the title of the ActionBar. I have tried putting the attributes <item name="android:textColor">@color/white</item> <item name="android:shadowRadius">1</item> <item name="android:shadowColor">@color/black</item> <item name="android:shadowDy">1</item> but while textColor is working, the shadow isn't. I am using ActionBarSherlock 3.5 but I think it would not work on native either. Thanks 回答1: I can't get this to work either on native or ABS backport. Using the

Activate CAB menu when OnClickEvent happens in Android

一个人想着一个人 提交于 2019-12-30 10:03:12
问题 Trying to activate CAB menu when clicking on MenuItem from ActionBar. Here is how I set the GridView for listening to Multi Choice. The multiModeChoiceListener is working fine when I long press on Any item in the GridView. It is working fine. Now I have a requirement to activate the CAB menu when do press on a menu item in Action Bar. Once it is pressed, the CAB menu should read that 0 items are selected. After that it should allow me to select items from GridView on single clicks. How can I

Determine if action bar is split

自闭症网瘾萝莉.ら 提交于 2019-12-30 08:18:07
问题 I have a MapView with an action bar powered by ActionBarSherlock. The action bar is both split (on "narrow" screens) and overlayed / semi-transparent (android:windowActionBarOverlay is true). More or less like the Google Maps app. Now I would like to push views on top of the map, at the bottom of the screen still keeping it above the bottom action bar. My problem here is that I don't know the height of the bottom action bar. Frankly, I can't even find a way to know if it's drawn or not.

add action bar with back button in preference activity [duplicate]

為{幸葍}努か 提交于 2019-12-30 06:04:13
问题 This question already has answers here : Creating a Preference Screen with support (v21) Toolbar (13 answers) Closed last year . Here is my preference activity: package com.example.hms.test; import android.os.Bundle; import android.preference.PreferenceActivity; public class PrefsActivity extends PreferenceActivity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); addPreferencesFromResource(R.xml.prefs); } } here I want to show an actionbar with name

add action bar with back button in preference activity [duplicate]

微笑、不失礼 提交于 2019-12-30 06:03:37
问题 This question already has answers here : Creating a Preference Screen with support (v21) Toolbar (13 answers) Closed last year . Here is my preference activity: package com.example.hms.test; import android.os.Bundle; import android.preference.PreferenceActivity; public class PrefsActivity extends PreferenceActivity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); addPreferencesFromResource(R.xml.prefs); } } here I want to show an actionbar with name

Android: Showing Action Bar menu items depending on ViewPager

流过昼夜 提交于 2019-12-30 06:02:10
问题 I am having trouble getting the following piece of code to work out. I have a viewpager with 3 fragments, and I want a search icon to only show up on one. I started off trying to add the search function by the fragment, but the rendering of the menu item was slow when swiping to that page. I am now on the part to add the search icon to the activity, and then just hide or show depending on which viewpager page is active, but the following is not working: public class MyApp extends

How To Center Icon in Android Action Bar

妖精的绣舞 提交于 2019-12-30 06:01:27
问题 I'm trying to center the icon in the android action bar. I'm using a custom layout that has a button on the left side, an icon in the center and the menu options on the right. <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/ActionBarWrapper" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <ImageButton android:id="@+id/slideMenuButton" android:layout

How to change ActionBar's action text color using AppCompat

╄→гoц情女王★ 提交于 2019-12-30 01:59:05
问题 I am trying to change the text color of a action menu item on the action bar. Using app compat. Also the overflow icon doesnt change too. Here is my custom styled styles.xml files. res/values/styles.xml <style name="AppTheme" parent="@style/Theme.AppCompat.Light"> <!-- Setting values in the default namespace affects API levels 7-13 --> <item name="actionBarStyle">@style/MyStyledActionBar</item> </style> <style name="MyStyledActionBar" parent="@style/Widget.AppCompat.Light.ActionBar"> <!--