Android View and ViewGroup

Hüseyin Özkoç
2 min readSep 17, 2021

Hey! Welcome to my article Dear Android Developers! and Dear Predators!

In this article, I am going to explain View and ViewGroup concepts as much as I can. First of all, I will start with definition of both.

1-View

View is the fundamental building block of the User Interface, and It is a small rectangular box that answer to user inputs. Likewise, View is the base class for all User interface widgets. If we want to give an example about the View class, they can be listed as follows.

  • TextView
  • EditText
  • Button
  • Image Button
  • Date Picker
  • RadioButton
  • CheckBox buttons
  • Image View
https://www.raywenderlich.com/142-android-custom-view-tutorial

Okey Then, What is the ViewGroup?

ViewGroup is a invisible container that include all Views in it. It is base class for layouts that holds all Views and determine(ViewGroup.LayoutParams) their properties. If we want to give an example about the ViewGroup class, they can be listed as follows.

  • LinearLayout
  • RelativeLayout
  • FrameLayout
  • TableLayout
  • CoordinatorLayout
  • ConstraintLayout
https://data-flair.training/blogs/android-layout-and-views/

I hope you understand the two concepts well! See you in other articles!

Photo by Amanda Sofia Pellenz on Unsplash

My Sources:

https://developer.android.com/reference/android/view/View

https://data-flair.training/blogs/android-layout-and-views/

https://www.formget.com/android-views/

--

--