Ive made an actionbar menu file and added it to my activity. The problem is its in the wrong place. Here is an image i found on android developer webpage:
At standard the actionbar was on location 1. When i a added a line like 'uiOptions="splitActionBarWhenNarrow"' into my manifest then the bar went to location 3. How can i make it stick to location 2 no matter what?
Also, how did they get that blue line under the action bar? :)
You cannot change the split Action Bar functionality, it is meant to be at the bottom when it is split. What Location 2 refers to are Action Bar tabs, not a split Action Bar.
Also, that "blue line" is part of the Action Bar's theme, which you can extend. This SO answer talks about changing the tab color specifically and provides a useful website to customize everything about the bar.
Related
Is there any possible way to center align the action item icons that are shown in action bar of titanium app for android. I have searched a lot of places for this solution but had no luck. I want the action bar to look like the below image. Also tell me the way to not show app title in the action bar.
This is not a Titanium issue.
As you can read in Google's documentation, you won't be able to center anything in the ActionBar. Default (and expected) behaviour is to align action icons on the right (or left if reversed).
I don't recommend it, as it goes against Google's guidelines, but you will be able to center icons if you create a fake ActionBar:
- Remove native ActionBar from any window in your app
- Create a Titanium View that mimics the ActionBar
- Add icons and bind click events.
That's it, you are done.
I want to customize navigation drawer app compact action bar, I want to remove app icon from that and want to make its title center in action bar.
I have applied all solutions , but nothing is working with all the conditions.
Please give me some clue for applying it correctly
You should creat a customize action bar. Then, if you want you can add a button that can open and close your drawerlayout.
I have solved my problem. As mentioned, I have two problems, and I solved that in following way :
1) For making title centre, we need to make custom layout of action bar, and need to remove action bar title.
2) for remove app icon from action bar, we need to set android:icon property of that activity in manifest with transparent image or colour.
Can anyone tell me how to do the following,
Remove The App Title bar & keep the action bar.
Move Tab Bar(Action Bar) to the bottom of the screen.
Remove Swipe Feature from the Tab.
Do this
Myactionbar().setDisplayShowTitleEnabled(false); Myactionbar().setDisplayShowHomeEnabled(false);
Where my action bar is the name of your action bar
you can add
android:theme="#android:style/Theme.NoTitleBar"
in your manifest file for your activity
We have to clarify some contents of your question:
the "app title bar" is part of the Action Bar, so they are the same thing; in other words you can't "divide" them, at last you can delete the title of your application;
you can't move the Action Bar to the bottom of the screen, but you can split it, as it says this official link (see Using split action bar paragraph); this can be do only if Action Bar is activated;
if you want to remove swipe feature from tab, see this StackOverflow question.
As you can see on this link and in this one, tabs on bottom are discouraged by Google (i don't wanna launch a discussion about this, forgive me).
But of course, you are free to do whatever you want with your app, and i found very usefull this solution.
That's all i can do. If you get struck again, post your code.
requestWindowFeature(Window.NO_ACTION_BAR)
would do the trick ! Do it before setting the content view.
To remove the very top bar Inside your oncreate() method place this
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
Now for the action bar to move it to the bottom there is no preset it can only be placed on the top unless you make your own interface visit this link
http://android-ed.blogspot.ca/2011/12/using-actionbar-at-bottom-of-screen.html
Hope that helps !
I would like to override (add more buttons that would take me to several activities/fragments) to the system Navigation Bar on a tablet (according to this android ui-overview it is a "Combined bar" (for tablets)
Is there a way to do this?
I couldn't find a Navigation class in the android.app package, like ActionBar.
If adding buttons to the combined/navigation bar is not possible, I think there are several options, but I'd like to explore this first:
- use the action bar on top instead
- add a bottom bar above the navigation bar (not really fine, since it would be on top of the combined bar), like they are showing here:
Action Bar
Thanks a lot,
Cristian
Is there a way to do this?
No. The only thing you can add to the system bar are Notifications, which are not meant for this sort of navigation.
If adding buttons to the combined/navigation bar is not possible, I think there are several options, but I'd like to explore this first: - use the action bar on top instead - add a bottom bar above the navigation bar (not really fine, since it would be on top of the combined bar), like they are showing here: Action Bar
If you are referring to the section titled "Layout Considerations for Split Action Bars", that is referred to as a "split action bar", and can be enabled on an <activity> via android:uiOptions="splitActionBarWhenNarrow". However, that will only take effect for -small/-normal screens in portrait orientation. Your buttons will automatically be placed in the action bar at the top of the screen in other circumstances.
i'm pretty confused on how to use action bar sherlock.. i've 'installed' it successfully in my apps (I can already see the bar at the top of my apps), but how do I 'configure' it? for example i use this
<item name="abDisplayOptions">useLogo|showHome|homeAsUp|showTitle</item>
so I can see the apps logo in the action bar, the 'back' button at the left side of the logo, but I don't know where should I put the code (and what code to write) to enable the 'back' buttons on action bar, clicking on logo will bring the user to the apps home, and other things such as put a search icon on the action bar and so on.. i tried looking at the actionbarsherlock google groups but I don't know what to search to help me...
Just check the samples here : https://play.google.com/store/apps/details?id=com.actionbarsherlock.sample.demos
And the corresponding code here : https://github.com/JakeWharton/ActionBarSherlock