Edit online

从 hello world 开始

3 Mar 2025
Read time: 1 minute(s)

面向对象的开发方式
1. 参数配置

lv_obj_t *main_label = lv_label_create(img_bg);

是什么,叫什么,来自哪里

lv_obj_set_height(main_label, 50);

lv_obj_set_width(main_label, 100);

高矮胖瘦

lv_obj_set_style_text_color(main_label, lv_color_hex(0x000000), 0);

lv_obj_set_style_bg_color(main_label, lv_color_hex(0x00ffff), 0);

肤色、发色、衣服颜色

lv_obj_set_pos(main_label, 50, 50);

站在哪里

lv_obj_add_event_cb(main_label, main_label_event, LV_EVENT_ALL, NULL);

准备干什么

hello world代码演示:

LVGL 更多控件使用方法

官方网站:LVGL: Light and Versatile Graphics Library — LVGL documentation

网上视频教程: