I need to show the following ActionBar:
Does Android support it, or do I need to do a custom layout and set it to the ActionBar?
Related
I'm creating an application for android 4.0 and above. I use the Holo.Light theme with dark ActionBar (Tabs as navigation mode).
The problem: there are too many icons (tabs) I'd need to place into the ActionBar, so I'm thinking about creating a custom TitleBar and placing some Buttons there to keep the functionality whilst not overspamming the ActionBar.
I tried the following:
requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
setContentView(R.layout.main);
getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.mytitle);
This causes the app to crash with following message:
08:00:24.063: E/AndroidRuntime(11283): java.lang.RuntimeException: Unable to start activity ComponentInfo{net.maver1ck.test/net.maver1ck.test.Main}: android.util.AndroidRuntimeException: You cannot combine custom titles with other title features
What are "other title features"? Is that possible to use the ActionBar and a custom title?
This is not so good idea to combine such bars. Insted of it use custom layout only.
I'm using ActionBar. I want to add splitter between icon and title: For example like here:
Nothing from these answers helped me:
Android actionbar sherlok doesn't show divider
ActionBar Divider Styling
ActionBar MenuItem Divider
I've tried to apply style to ActionBar but Eclipse shows this:
android:showDividers requires API level 11 (current min is 9)
What should I do?
the easiest way is to add divider logo. If later you want it is not displayed click, just make its selector and put a logo without the divider for statepressed but with the same dimensions.
In my app I have ActionBar with tabs and I want to make tabs translucent, but not ActionBar. Is it possible to achive this via styles and themes?
You can use custom layout and inflate it to use it as tabs
Please find it here : https://stackoverflow.com/a/10013297/951045
and to hide actionbar use
getSupportActionBar().hide(); // if you are using support lib
otherwise use getActionBar().hide();
You can also hide actionbar by using Theme.Sherlock.NoActionBar (for support lib)
Hi everyone I am working currently a view which need to have a view above the tabs of the actionbar or more like below the action bar itself, and a fixed footer between the tabs.
But I have not find a way to make this behaviour other than adding the footer in each fragment and the view that I want below the tabs.
Is there a way to put headers(above) and footer(below) tabs using the actionbar?
PD. I am using Sherlock actionbar
Something inbetween the Actionbar and the Actionbar tabs? AFAIK it's not possible. ABS is only used in pre HC versions. On ICS+ the default ActionBar gets used. Therefore even if you can customize the ABS Actionbar you most likely can't override the default Actionbar on ICS+.
I am trying to remove the title from my action bar and reclaim the space it would otherwise consume for the use of menu items.
I have tried using a custom theme but so far nothing has worked. I have tried changing the text size to 0sp, changing the color to transparent, and setting visibility to gone.
I have also tried this :
ActionBar actionbar = getActionBar();
actionbar.setDisplayShowTitleEnabled(false);
I am targeting sdk 15+ and using the standard Android action bar (i.e. not Sherlock).
Thanks for any suggestions.
Here's what I'm talking about (the area bordered in red I want back):
Did you check out the ActionBar documentation yet? There's a method, setDisplayShowTitleEnabled(boolean) that does what you need.
Simply get a reference to your ActionBar, and call that with false:
ActionBar actionBar = getActionBar();
actionBar.setDisplayShowTitleEnabled(false);