natiny.view.set_rows
natiny.view.set_rows(view, rows)
Sets how many rows a natiny.view.GRID view has at least.
Parameters
| Name | Type | Description |
|---|---|---|
view |
number |
View handle |
rows |
integer |
Least number of rows; 0 for as many as the children need |
Example
-- two rows of buttons, as many columns as it takes
local keys = natiny.view.create(natiny.view.GRID, panel)
natiny.view.set_rows(keys, 2)
-- a 4 by 3 board that keeps its shape with only a few pieces on it
local board = natiny.view.create(natiny.view.GRID, root)
natiny.view.set_columns(board, 4)
natiny.view.set_rows(board, 3)