Why do we use gridlayout in android

Answer

LinearLayout and RelativeLayout are the most common layouts used in user interface design in Android. For simple user interfaces they are a good choice but when the user interface gets complicated, the use of nested LinearLayout tends to increase. Nested layouts (of any type) can hurt performance, and furthermore nested LinearLayout deeper than 10 may cause a crash in your application. Thus, you should either avoid using too many nested LinearLayout blocks or you should use RelativeLayout in order to decrease nested LinearLayout blocks. Another drawback of these layouts for complicated user interfaces is the difficulty in readability. It is difficult to maintain nested LinearLayout or RelativeLayout layouts that have many views. It is a good choice to use GridLayout in these cases. Too many nested LinearLayouts could be avoided by using GridLayout. Furthermore, it is much easier to maintain GridLayout. Many of the user interfaces that use LinearLayout, RelativeLayout, or TableLayout can be converted to GridLayout where GridLayout will provide performance enhancements. One of the major advantages of GridLayout over other layouts is that you can control the alignment of a view in both horizontal and vertical axis.

All Android Questions

Ask your interview questions on android

Write Your comment or Questions if you want the answers on android from android Experts
Name* :
Email Id* :
Mob no* :
Question
Or
Comment* :
 





Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website. If you are using this website then its your own responsibility to understand the content of the website

--------- Tutorials ---