natiny_view_set_layout

C
void natiny_view_set_layout(NatinyView view, uint32_t layout);

Sets how a view places its children.

Parameters

Name Type Description
view NatinyView View handle
layout uint32_t One of the constants below

Constants

Constant Children are placed
NATINY_LAYOUT_FREE Independently from the content box's top-left corner
NATINY_LAYOUT_VERTICAL Top to bottom
NATINY_LAYOUT_HORIZONTAL Left to right
NATINY_LAYOUT_CENTER In the center of the content box
NATINY_LAYOUT_GRID In cells, left to right and top to bottom

Example

C
natiny_view_set_layout(toolbar, narrow ? NATINY_LAYOUT_VERTICAL : NATINY_LAYOUT_HORIZONTAL);