Android L 中不推荐使用操作栏导航模式 [英] Action bar navigation modes are deprecated in Android L
问题描述
查看AndroidL"预览的API差异报告,我看到ActionBar
类中所有与导航模式相关的方法(例如setNavigationMode()
code>、addTab()
、selectTab()
、&c).现已弃用.
Taking a look at the API diff report for the Android "L" preview, I see that all methods related to navigation modes in the ActionBar
class (such as setNavigationMode()
, addTab()
, selectTab()
, &c). are now deprecated.
文档说明:
不推荐使用操作栏导航模式,内联不支持工具栏操作栏.考虑使用其他常见的导航模式相反.
Action bar navigation modes are deprecated and not supported by inline toolbar action bars. Consider using other common navigation patterns instead.
所谓的替代品是什么?
此外,内联工具栏操作栏"是一个新概念吗?我想我以前没听说过.
Also, is "inline toolbar action bars" a new concept? I don't think I've heard of it before.
推荐答案
新的 Android Design Support Library 增加了TabLayout,提供了一个tab实现符合标签的材料设计指南.此视频
The new Android Design Support Library adds TabLayout, providing a tab implementation that matches the material design guidelines for tabs. A complete walkthrough of how to implement Tabs and ViewPager
can be found in this video
现已弃用:PagerTabStrip 是支持库的一部分(已经有一段时间了)并作为直接替代品.如果您更喜欢较新的 Google Play 样式标签,可以使用 PagerSlidingTabStrip 库 或修改 Google 提供的任一示例 SlidingTabsBasic 或 SlidingTabsColors 如本开发字节视频中所述.
Now deprecated: The PagerTabStrip is part of the support library (and has been for some time) and serves as a direct replacement. If you prefer the newer Google Play style tabs, you can use the PagerSlidingTabStrip library or modify either of the Google provided examples SlidingTabsBasic or SlidingTabsColors as explained in this Dev Bytes video.
这篇关于Android L 中不推荐使用操作栏导航模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!