问题
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.
回答1:
Do this
Myactionbar().setDisplayShowTitleEnabled(false); Myactionbar().setDisplayShowHomeEnabled(false);
Where my action bar is the name of your action bar
回答2:
you can add
android:theme="@android:style/Theme.NoTitleBar"
in your manifest file for your activity
回答3:
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.
回答4:
requestWindowFeature(Window.NO_ACTION_BAR)
would do the trick ! Do it before setting the content view.
回答5:
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 !
来源:https://stackoverflow.com/questions/22267361/android-remove-title-bar-actionbar