Android: What's the difference between a title bar and an ActionBar

我的梦境 提交于 2019-12-04 16:18:51

问题


I can't tell if they're the same thing or not and they seem to have different methods for removing them but I'm not sure if those are just multiple methods to do the same thing or not.

So is there a difference and if there is what is it?

Ref:

  • https://developer.android.com/reference/android/R.id.html#title
  • https://developer.android.com/reference/android/app/ActionBar.html (with material design, it is usually represented by a Toolbar)

回答1:


The Title bar is a small part of the UI that you can supply with some text and a color. You see it on a lot of Android 2.0 Apps. See here

The Actionbar is the bar with buttons that has back navigation etc. If you can chose, you use it instead of the Titlebar. See here




回答2:


Different thing.

TitleBar - small (usually grey) strip at top of screen that lists your Application Name (mostly not used anywhere)

ActionBar - the core navigation component of modern Android apps - this is where you will put the main navigation components (including actions on the things in your activity, a title explaining where you are in the app, Share links, etc); To support this in all modern Android versions, you will need to use a library to implement this. ActionBarSherlock is a very popular one, and there is now ActionBarCompat, which was released in the latest Support Library.

Bottom line, TitleBar should be disabled in favor of ActionBar for applications targeting modern design standards



来源:https://stackoverflow.com/questions/19279222/android-whats-the-difference-between-a-title-bar-and-an-actionbar

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