Android Common Layouts Comparison
Hi to all my android developers today I come up with the layouts comparison the common android layouts comparison which layouts we need to use and why most of the developers confused which layout prefer over another so friends today I’ll demonstrate which layout is better in Android, in terms of performance as performance is the major concern in android.
The relative layout is the most common android layout used in the applications, even I also used, now what is Relative layout?
A relative Layout is a view group that displays child views in relative positions.
Recently I explored something that relative layout rendered its child’s two times means it draws two times so it will take time to render into the screen which causes the performance issue.
now, on the other hand, we have a linear layout which is also the most common android layout used in the applications.
Linear Layout is basically a layout in which you can set your child views in horizontal/vertical.
When we used linear layout it will render its child only one time so in that case, a linear layout is preferred over the relative layout in terms of performance, but when we used weight-sum in linear layout then it will also be rendered its child two times which will take longer time to drawn on the view.
Linear-Layout is better over Relative-Layout.
Thanks for reading this article. Be sure to clap to recommend this article if you found it helpful. It means a lot to me.