Changes

Jump to: navigation, search

Working with the Android GridLayout in XML Layout Resources

No change in size, 19:20, 3 February 2014
Declaring Cell Spanning, Gravity and Margins
</pre>
The above resource file appears exactly as it was created by the Graphical Layout tool in the preceding chapter. As can be seen, it contains a GridLayout manager declared to be 3 columns wide. It contains four Button views with cell positions specified by row and column properties. Finally, the row and column span values, along with gravity properties are used to make two of the buttons span multiple cells. When deployed within an application, this XML layout would appear as illustrated in Figure 1615-1213.
== Summary ==
As an alternative to using the Graphical Layout editor to design GridLayout based user interface elements, the same objective may also be achieved by manually creating XML layout resources. Having covered the use of the graphical layout approach in the previous chapter, this chapter has covered the concepts of declaring a GridLayout and positioning and configuring child views within an XML resource file.

Navigation menu