Android View and ViewGroup with Examples

  Total Views : 156
  Comments : 0
  Keywords : Android view object to build user interface (UI) elements of an application, Android viewgroup is an invisible container to hold view and viewgroup

Here we will learn android view and viewgroup, difference between android view and viewgroup and how to use android view and viewgroup to create UI components with examples.

Android View and ViewGroup

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 will contain one or more activities and each activity is a one screen of app. The activities will 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 will 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.

 

Like these we have many View subclasses available in android.

Android ViewGroup

The ViewGroup is a subclass of View and it will act as a base class for layouts and layouts parameters. The ViewGroup will provide 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.

 

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

 Comments (0)

Be the first to give your valuable feedback

Leave a comment

  • Default Tutlane User