Android - Remove Title Bar (ActionBar)

孤街浪徒 提交于 2019-12-25 02:09:14

问题


Can anyone tell me how to do the following,

  1. Remove The App Title bar & keep the action bar.
  2. Move Tab Bar(Action Bar) to the bottom of the screen.
  3. 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:

  1. 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;
  2. 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;
  3. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!