问题描述
我已将我的 Android Studio 更新到 3.1 稳定版.我注意到调色板窗口中的所有"选项卡被删除并引入了传统"选项卡.该选项卡包含以下内容:
I've updated my Android Studio to 3.1 stable channel. I've noticed that "All" tabs in palette window are removed and "Legacy" tab is introduced. That tab contains the following:
- 列表视图
- TabHost
- 相对布局
- 网格视图
我没有提到 GridLayout
因为它是可下载的依赖项,而不是来自 Android API 的视图.
I didn't mention the GridLayout
because it's a downloadable dependency rather than a View from the Android APIs.
哪些新视图取代了上面提到的视图?
Which new Views have replaced the views mentioned above?
我知道 ConstraintLayout
替换了 RelativeLayout
,但是什么替换了 ListView
、GridView
或 标签主机
?我想了解最新情况.
I know ConstraintLayout
replaces RelativeLayout
, but what replaces the ListView
, the GridView
or the TabHost
? I want to be up-to-date.
推荐答案
ListView
- 替换为 RecyclerView
TabHost
- 替换为 TabLayout
RelativeLayout
- 替换为 ConstraintLayout
GridView
- 替换为 ConstraintLayout
主要是因为新的性能更好.
Mostly due to the new ones having better performance.
RecyclerView.Adapter
实现了流行和推荐的持有者模式,并支持现代布局转换.它还接受布局管理器,允许您轻松实现网格.
RecyclerView.Adapter
has implemented the popular and recommended holder pattern and supports modern layout transitions. It also accepts a layout manager allowing you to easily implement a grid.
这篇关于为什么有些视图位于 Android Studio 3.1 中的旧版选项卡内,哪些替换了它们?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!