natiny.view.get_layout
Lua
natiny.view.get_layout(view) -> layout
Returns how a view places its children.
Parameters
| Name |
Type |
Description |
view |
number |
View handle |
Returns
| Type |
Description |
integer |
One of the constants below; natiny.view.FREE for an invalid handle |
Constants
| Constant |
Children are placed |
natiny.view.FREE |
Independently from the content box's top-left corner |
natiny.view.VERTICAL |
Top to bottom |
natiny.view.HORIZONTAL |
Left to right |
natiny.view.CENTER |
In the center of the content box |
natiny.view.GRID |
In cells, left to right and top to bottom |
Example
Lua
if natiny.view.get_layout(list) == natiny.view.GRID then
natiny.view.set_columns(list, 4)
end