android-actionbar

How to set the height of the split action bar?

爷,独闯天下 提交于 2019-12-11 13:33:11
问题 I'am using the ActionBarSherlock and meet a strange problem, I can set the height of the ActionBar at the top, but the split ActionBar at the bottom is to big. I want to know how to set the height of the split action bar? thanks! 回答1: I have solved the problem myself, it's because the actionbar icon is too big, when i fix the icon size, the height of the actionbar become normal. I've learnt that the size of the icon must adapt the device dpi. And this site: http://iconhandbook.co.uk/reference

ActionBar changes colour after changing phone orientation and closing Contextual Action Bar

末鹿安然 提交于 2019-12-11 13:14:48
问题 Problem First my ActionBar (with custom menu) is purple, then: Trigger CAB by long-click on my ListView Change phone orientation Cancel CAB ActionBar becomes white. This does not happen without phone orientation change. I have tried this on android 4.4.4 , minSdkVersion="19" , targetSdkVersion="26" . Can you please advise me, why this could happen? UPDATE: Tried on API 25 emulator, and this does not happen. Sources Activity layout: <android.support.constraint.ConstraintLayout xmlns:android=

Android - want to show 3-dots menu on ICS

帅比萌擦擦* 提交于 2019-12-11 12:56:12
问题 I want to show the 3-dot overflow menu key (next to the RecentApp virtual key) when building my app with android:targetSdkVersion="15" Here is my story. My app includes two lib projects (only jars + res no source), lib-a is using menu; when the app was built with target-sdk=10, works well, the 3-dot icon shows up next to RecentApp key on system navigation bar. Now lib-b got upgraded, I HAVE to build the app with target-sdk=15, but this makes lib-a UI menu disappear. I want lib-a to have menu

Robolectric: actionBar.hide() returns Null

懵懂的女人 提交于 2019-12-11 12:38:59
问题 I'm new to Android unit testing and I'm using Robolectric as a testing framework. I use Robolectric 2.2. I'm trying to test an activity which is like that : public class LoginActivity extends SherlockActivity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_login); ActionBar abs = getSupportActionBar(); abs.hide(); } and here's my test class : @RunWith(RobolectricTestRunner.class) public class LoginActivityTest

ActionBar not working

房东的猫 提交于 2019-12-11 12:34:34
问题 I need some guidance regarding the working of Action bar. Actually clicking on a Action bar MenuItem . Current activity must be moved to another activity. But it's doing nothing. Not even any error. I used following code: @Override public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.mnew1, menu); return super.onCreateOptionsMenu(menu); } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle presses on the

How do I keep ActionBar items' background the same while changing the app's main background?

橙三吉。 提交于 2019-12-11 12:18:24
问题 I am trying to change the background of the app, but when I do the below (sdk 14) the items in the actionbar also change to match the new background color. The actionbar itself has the correct background, but the items in the actionbar do not. I was able to get the actionbarmenuitems to be correct, but the title and search view and home icon and back button all have the background set on the custom theme. What am I doing wrong? <?xml version="1.0" encoding="utf-8"?> <resources> <style name=

Navigation Drawer on the top of ActionBar / StatusBar like Android 5.0 without using AppCompact / ToolBar

徘徊边缘 提交于 2019-12-11 11:58:07
问题 I am trying to reskin Q-Municate and i am stuck with the Navigation Drawer Reskin task My current Navigation Drawer looks like this And i want my navigation Drawer as per request design like this I have already gone through each and every possible solutions given over StackOverFlow regarding this task, i have also followed a working tutorial given over here but could not find it working My Code is attached here activity_main.xml <android.support.v4.widget.DrawerLayout xmlns:android="http:/

Resize Application name in action bar

∥☆過路亽.° 提交于 2019-12-11 11:53:39
问题 In my application I have 4 buttons in the Action Bar. I added android:showAsAction="always|withText" to each item in the xml file in order to force show all 4 of the icons. I am testing the app on a 4.0" screen, and in vertical view I see the application icon on the left, the app name is cut, and then i see the 4 icons/buttons. For example, the app name is Pandemic, and with all 4 icons in the action bar, i see Pan... How can I have the application name text resiz to dynamically to fill

Sherlock Actionbar change menu background color

风格不统一 提交于 2019-12-11 11:45:38
问题 I need to change the background of menu items only. When I tried with actionBarItemBackground, it changes the background of application logo [As u can see in the attachment] also. Any help or link will be appreciated. 回答1: You can use a custom layout for your actionbar item like so: <menu xmlns:android="http://schemas.android.com/apk/res/android" > <item android:id="@id/item_text" android:showAsAction="always" android:actionLayout="@layout/action_text"/> </menu> This is styleable as you wish.

My action bar title is taking the wrong color from theme

不打扰是莪最后的温柔 提交于 2019-12-11 11:44:40
问题 I'm attempting to modify the theme for my application. I've been able to successfully set the background color for my app, and the background color for my action bar. Unfortunately, the background color of the items WITHIN the action bar are taking the background color of the app, not the bg color of the action bar. Here's my code from styles.xml <!-- Base application theme for API 11+. This theme completely replaces AppBaseTheme from res/values/styles.xml on API 11+ devices. --> <style name=