January 2014
Intermediate to advanced
736 pages
70h 43m
English
The default layout in activity_main.xml is a FrameLayout. Here, you’ll change that to a GridLayout. Right click the RelativeLayout in the Outline window and select Change Layout.... In the Change Layout dialog, select GridLayout and click OK. The IDE changes the layout and sets its Id to GridLayout1. We changed this to gridLayout using the Id field in the Properties window. By default, the GridLayout’s Orientation property is set to horizontal, indicating that its contents will be laid out row-by-row. Ensure that the GridLayout’s Padding Left and Padding Right properties are set to activity_horizontal_margin and that the Padding Top and Padding Bottom properties are set to activity_vertical_margin.
Read now
Unlock full access