gpt4 book ai didi

android - Action Bar 和新引入的 Toolbar 有什么区别?

转载 作者:IT老高 更新时间:2023-10-28 12:53:47 27 4
gpt4 key购买 nike

在 Google 推出 Material Design 之后,我听说了一个名为 Toolbar 的新小部件类。

什么是 Toolbar,ActionBar 和 ToolBar 之间的确切区别是什么?

最佳答案

我从 Android Developers Blog post 找到了一个很好的解释.

In this release, Android introduces a new Toolbar widget. This is a generalization of the Action Bar pattern that gives you much more control and flexibility. Toolbar is a view in your hierarchy just like any other, making it easier to interleave with the rest of your views, animate it, and react to scroll events. You can also set it as your Activity’s action bar, meaning that your standard options menu actions will be display within it.

是的,我们 Android 开发人员需要更多地控制 ActionBar,对吗?而 Toolbar 就是为了它。

换句话说,ActionBar 现在变成了一种特殊的Toolbar。这是 Google's official Material Design spec document 的摘录.

The app bar, formerly known as the action bar in Android, is a special kind of toolbar that’s used for branding, navigation, search, and actions.

更多细节如如何使用 Toolbar 作为 ActionBar 包含在上面的博文中。

关于android - Action Bar 和新引入的 Toolbar 有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27665018/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com