Why are some views inside the legacy tab in Android Studio 3.1 and what replaces them?

点点圈 提交于 2020-06-24 02:12:19

问题


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:

  • ListView
  • TabHost
  • RelativeLayout
  • GridView

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?

I know ConstraintLayout replaces RelativeLayout, but what replaces the ListView, the GridView or the TabHost? I want to be up-to-date.


回答1:


ListView - replaced with RecyclerView

TabHost - replaced with TabLayout

RelativeLayout - replaced with ConstraintLayout

GridView - replaced with ConstraintLayout

Mostly due to the new ones having better performance.

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.



来源:https://stackoverflow.com/questions/50079026/why-are-some-views-inside-the-legacy-tab-in-android-studio-3-1-and-what-replaces

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