"One XML file has only one root tag"
PermalinkSo why is this root tag important ๐
The answer is when we take root tag through layout (just like canvas is used to paint, right... We take layout in order to use View and ViewGroup)
If you want to use lots of View and/or lots of ViewGroup then you have to take a root layout which is ViewGroup in which we can use multiple ViewGroup.
Note :- Every layout is ViewGroup but every ViewGroup need not to be a layout ๐ฅฒ
PermalinkIn Android there are lots of layouts. Here are some Common layouts listed
- Example
- 1) Linear Layout
- 2) Relative Layout
- 3) Web View
![linearlayout-small.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1668686628548/9aqBoCWT8.png?auto=compress,format&format=webp)
and more...
But by default in Android Studio we get constraint layout.
![photo_2022-11-17_17-22-21.jpg](https://cdn.hashnode.com/res/hashnode/image/upload/v1668685964540/KtdgVSa20.jpg?auto=compress,format&format=webp)
Till then...
Stay tuned ๐