Android implementation method of nine palace grid (each bisector space in GridView)

This article describes the method of realizing the nine palace grid (each bisection space in GridView) by Android. Share with you for your reference. The details are as follows:

The project needs to make a nine palace grid (not necessarily 9, 4 palace grid, 16 palace grid, 4x3 palace grid...) and seal a palace grid, which can automatically adjust the size of each item in the palace according to the space allocated to it.

It is integrated from tablelayout. Therefore, if you use this package directly on the designer, you need to delete the tablerows automatically added to it.

The class name is advancedgridview, and the code is as follows:

If you want to see the grid effect at the design stage, you can set the number of rows and columns on the tag property of the space. For example, if I want to see the appearance of 3X3, it will be set to "3,3". As shown below, you can use setRowNum () and setColNum () to set up the code, but please call these two methods before setting up the adapter.

I hope this article will be helpful to your Android program design.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>