Difference between GridLayout and GridView: gridlayoutgridview

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.