View and ViewGroup: The Building Blocks of Android UI
A View is a single UI widget like a button; a ViewGroup is a container that arranges them. This is the fundamental structure for all Android UIs. The common footgun is creating deeply nested ViewGroups, which slows down rendering performance.
View and ViewGroup are the two fundamental classes for building an Android UI. A View is a single interactive element like a button or text field, while a ViewGroup is an invisible container, like LinearLayout, that organizes child Views. You use them to define a screen's layout, forming a tree structure. The most common pitfall is creating deeply nested layouts (a ViewGroup inside another...), which hurts performance because each layer adds overhead to the measurement and drawing passes.
Read the original → developer.android.com
- #android
- #ui
- #view
- #viewgroup
Get five bites like this every day.
Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.