1#
2# Arrange items in rows with wrap and place the items to get even space around them.
3#
4style = lv.style_t()
5style.init()
6style.set_flex_flow(lv.FLEX_FLOW.ROW_WRAP)
7style.set_flex_main_place(lv.FLEX_ALIGN.SPACE_EVENLY)
8style.set_layout(lv.LAYOUT_FLEX.value)
9
10cont = lv.obj(lv.scr_act())
11cont.set_size(300, 220)
12cont.center()
13cont.add_style(style, 0)
14
15for i in range(8):
16    obj = lv.obj(cont)
17    obj.set_size(70, lv.SIZE.CONTENT)
18
19    label = lv.label(obj)
20    label.set_text("{:d}".format(i))
21    label.center()
22
23