1
0
forked from uestc/Notes
Notes/硬件开发笔记/ESP32/LVGL常用函数笔记.md
2024-10-17 15:36:48 +08:00

22 lines
487 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# LVGL常用函数笔记
## 一、屏幕操作相关
**1.1 获取屏幕的对象**
```C
lv_obj_t * lv_scr_act(void) // 获取当前活动屏幕的指针
```
**1.2 在屏幕上创建对象**
```C
// 获取当前屏幕对象并创建对象
lv_obj_t* root_obj = lv_obj_create(lv_scr_act());
// 设置对象背景颜色
lv_obj_set_style_bg_color(root, lv_color_black(), 0);
// 设置对象背景透明度 Opacity透明度
lv_obj_set_style_bg_opa(root, LV_OPA_COVER, 0);
```
1.3