In last blog of Android Development I talked about 3 commonly used views .
And In today's blog I will be discussing about viewgroup.
What are ViewGroup?
In simple terms ViewGroup works as a container in which we can add blocks of views.A ViewGroup is a big View that can contain smaller Views inside of it. The smaller Views are called the children of the ViewGroup and might be TextViews or ImageViews.
Types of ViewGroup👇
- LinearLayout
RelativeLayout
3.ConstraintLayout
(This is default layout when you create your first project on Android studio.)
https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayoutFrameLayout
AbsoluteLayout
List View
Grid View
etc
For instance we will focus on most commonly used Layouts for now👇
- LinearLayout
- RelativeLayout
1.LinearLayout ⬇️
1.1 What is LinearLayout ?
➡️ It is a view group that aligns all children in a single direction, vertically or horizontally.
(In term of web development)[LinearLayout in Android is similar to Flex in Web Development]
1.2 Attributes of LinearLayout👇
i. android: orientation
➡️ We can specify the layout direction whether we want orientation vertical or horizontal using this attribute.
Top comments (0)