Difference between GridLayout and GridView: gridlayoutgridview
The GridView is an adapter layout. Its inheritance relationship is ViewGroup --> AdapterView --> AbsListView --> GridView, which extracts content from an adapter and fills in each subview in the GridView.
GridLayout is a layout that greatly simplifies the processing of Complex layout and improves performance. He directly inherits from ViewGroup, which is similar to LinearLayout.
I think the difference between GridView and GridLayout is similar to that between ListView and LinearLayout.
So when to use GridView and GridLayout? Similar to the jiugongge type, you can use the GridView. However, the interfaces of calculators that come with Android systems cannot be implemented through the GridView, because some buttons are different and big. If GridLayout is used, it is very easy to implement.
In addition, GridLayout is easier to use than RelativeLayout. For example, for a login interface, the login interface should have the title of the login interface, the label of the user name and password, the input box, And the confirm login button, if relative layout is used, the location relationship between the control and the control must be complex and cumbersome. When the Android Framework renders the relative layout xml file you have defined to the screen, it needs to deal with the relationship between such complex controls, and certainly the performance will be affected to a certain extent. Of course, it is better to use relative layout than to use multiple linear layout nesting. However, if GridLayout is used, rendering performance is much better than relative layout. Because the positional relationship between controls in GridLayout is not that complex, it means that a control is placed in a certain column of a row, which occupies several rows or occupies several columns. The layout xml is also very simple to write.