What are the advantages of using nested layouts in android? Why not just use layouts without nesting? It is usually seen in 'compose message' activity layout. Coders use nested layouts to place the 'send' button in the bottom. Why not just as it is place it in the last?
Asked
Active
Viewed 248 times
0
-
Build some layouts and you will eventually find that a lot of them will need to be nested to get what you want. – codeMagic Oct 18 '15 at 17:53
-
nesting does what basically? – Ayushi Singh Oct 18 '15 at 17:55
1 Answers
1
The reason you'd want to nest a layout is the same reason you'd create a separate class/method to do specific things. It breaks apart your code and organizes it better. The nested layout would be something you might modify more frequently, while the layout that holds it would stay static (for the most part).
A good example would be if you create a brand new project in android studio 1.4, it creates two activities for main. One has all your floating action button (fab) and all, the other is for your formatting. If you don't want to touch the fab, then you don't have to, you only have to deal with your layout, it also looks a lot cleaner, which makes it easier to edit.

Spider
- 431
- 7
- 21