初级会员
- 积分
- 185
- 金钱
- 185
- 注册时间
- 2020-5-21
- 在线时间
- 58 小时
|
楼主 |
发表于 2022-3-2 08:41:06
|
显示全部楼层
LVGL 回复:
Just simply add img first on the screen, and then any other widget can be added after it to screen, or just a child of img.Visible LVGL “screen” can be built as tree-hierarchy from the objects (just like HTML DOM), so you add also child LVGL objects to img.
For example (MicroPython code):
screen = lv.obj() # Set background image background_image = lv.img(screen) background_image.center() # Add child button to parent screen, it will be shown in front of background image button1 = lv.btn(screen) button1.set_pos(x, y) # Add child button to image parent, it will be also shown in front of background image button2 = lv.btn(background_image) button2.set_pos(x, y) # Show screen lv.scr_load(screen) |
|