acid-drop- Hacking the planet from a LilyGo T-Deck using custom firmware |
git clone git://git.acid.vegas/acid-drop.git |
Log | Files | Refs | Archive | README | LICENSE |
lv_example_flex_2.py (516B)
1 # 2 # Arrange items in rows with wrap and place the items to get even space around them. 3 # 4 style = lv.style_t() 5 style.init() 6 style.set_flex_flow(lv.FLEX_FLOW.ROW_WRAP) 7 style.set_flex_main_place(lv.FLEX_ALIGN.SPACE_EVENLY) 8 style.set_layout(lv.LAYOUT_FLEX.value) 9 10 cont = lv.obj(lv.scr_act()) 11 cont.set_size(300, 220) 12 cont.center() 13 cont.add_style(style, 0) 14 15 for 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