From the course: Programming for Non-Programmers: Android & Kotlin

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Arrange buttons in a grid layout

Arrange buttons in a grid layout

From the course: Programming for Non-Programmers: Android & Kotlin

Start my 1-month free trial

Arrange buttons in a grid layout

- [Instructor] Our next step is to layout buttons within the grid. If you look at this example here, you'll see that there are four columns and four rows of buttons. So we'll need to specify that in our grid layout. So I'll tab over to Android Studio, and we'll take care of that. First, select the Grid Layout in the Component Tree. You can specify your numbers of rows and columns through the column count and row count attributes. In order to see those attributes you'll need to be in the View all attributes screen. You can toggle that by clicking the arrows in Attributes window bar, or by clicking the View all attributes button at the bottom of the Attributes window. When you're in there, click the search field and search for count. You should then see column count and row count. If the words are cut off at all, you can actually click and drag this line that divides the editor and Attributes windows so you can see more. So with that filter, I'm going to type in four, for both column…

Contents