first commit
This commit is contained in:
commit
e6a42e28e9
4355 changed files with 4626605 additions and 0 deletions
22
libraries/lvgl/examples/layouts/flex/lv_example_flex_2.py
Normal file
22
libraries/lvgl/examples/layouts/flex/lv_example_flex_2.py
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
#
|
||||
# Arrange items in rows with wrap and place the items to get even space around them.
|
||||
#
|
||||
style = lv.style_t()
|
||||
style.init()
|
||||
style.set_flex_flow(lv.FLEX_FLOW.ROW_WRAP)
|
||||
style.set_flex_main_place(lv.FLEX_ALIGN.SPACE_EVENLY)
|
||||
style.set_layout(lv.LAYOUT_FLEX.value)
|
||||
|
||||
cont = lv.obj(lv.scr_act())
|
||||
cont.set_size(300, 220)
|
||||
cont.center()
|
||||
cont.add_style(style, 0)
|
||||
|
||||
for i in range(8):
|
||||
obj = lv.obj(cont)
|
||||
obj.set_size(70, lv.SIZE.CONTENT)
|
||||
|
||||
label = lv.label(obj)
|
||||
label.set_text("{:d}".format(i))
|
||||
label.center()
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue