0% found this document useful (0 votes)
50 views

Android View and ViewGroup With Examples

Uploaded by

israth.sumona
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views

Android View and ViewGroup With Examples

Uploaded by

israth.sumona
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

3.

1
Android View and ViewGroup with Examples
In android, Layout is used to define the user interface for an app or activity and it will hold the UI
elements that will appear to the user.

The user interface in android app is made with a collection of View and ViewGroup objects. Generally,
the android apps contain one or more activities and each activity is a one screen of app. The activities
contain a multiple UI components and those UI components are the instances
of View and ViewGroup subclasses.

The user interface in android app is made with a collection of View and ViewGroup objects. Generally,
the android apps will contain one or more activities and each activity is a one screen of app. The
activities contain a multiple UI components and those UI components are the instances
of View and ViewGroup subclasses.

Android View

The View is a base class for all UI components in android. For example, the EditText class is used to
accept the input from users in android apps, which is a sub class of View.

Following are the some of common View subclasses which will be used in android applications.

 TextView
 EditText
 Button
 CheckBox
 RadioButton
 ImageButton
 Progress Bar
 Spinner

Like these we have many View subclasses available in android.

Android ViewGroup

The ViewGroup is a subclass of View and it acts as a base class for layouts and layouts parameters.
The ViewGroup provides an invisible containers to hold other Views or ViewGroups and to define the
layout properties.

For example, Linear Layout is the ViewGroup that contains a UI controls like button, textview, etc. and
other layouts also.

Following are the commonly used ViewGroup subclasses in android applications.


 Linear Layout
 Relative Layout
 Table Layout
 Frame Layout
 Web View
 List View
 Grid View

1
Both View and ViewGroup subclasses together will play a key role to create a layouts in android
applications.
Questions

1. What are the Android View and ViewGroup?


2. How many types of Android Layout?

You might also like