What is the difference between a layout and a container in Android?

后端 未结 3 2164
温柔的废话
温柔的废话 2021-02-12 14:31

In android studio, in design section, Layouts and Containers are categorized separately.

What is the fundamental difference between them?

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-12 14:40

    Layouts all directly extend ViewGroup. The Layout suffix is part of the class name for classes in this group, e.g. LinearLayout, RelativeLayout.

    Containers is a bucket description for Views that wrap dynamic content. They are more specialized than Layouts and can but don't have to extend a Layout. Some extend ViewGroup indirectly e.g ListView, some don't e.g. VideoView. The Container label is used in Android Studio but is not part of the class name.

提交回复
热议问题