Should we replace Action Bar by ToolBar?

后端 未结 10 1497
日久生厌
日久生厌 2020-12-12 19:11

I have been using ToolBar since it was added into Support v7 library. And I think I used it well. But there is a point I can\'t understand. Why

10条回答
  •  庸人自扰
    2020-12-12 19:33

    A Toolbar is a generalization of action bars for use within application layouts. While an action bar is traditionally part of an Activity's opaque window decor controlled by the framework, a Toolbar may be placed at any arbitrary level of nesting within a view hierarchy. An application may choose to designate a Toolbar as the action bar for an Activity using the setActionBar() method. You can find more info here. We replaced our actionbar, as it was easier to customize toolbar for material design. Color palettes and disappearing animation behavior for example. Personally, I don't understand why android throws away old controls and create new one. Another example would be RecyclerView. Don't understand why they just didn't improve old API.

提交回复
热议问题