以前版本的只有修改style里面lv_style_scr的main_color和grad_color就可以了
void lv_style_init(void)
{
/* Not White/Black/Gray colors are created by HSV model with
* HUE = 210*/
/*Screen style*/
lv_style_scr.glass = 0;
lv_style_scr.body.opa = LV_OPA_COVER;
lv_style_scr.body.main_color = LV_COLOR_WHITE;
lv_style_scr.body.grad_color = LV_COLOR_WHITE;
lv_style_scr.body.radius = 0;
lv_style_scr.body.padding.ver = LV_DPI / 12;
lv_style_scr.body.padding.hor = LV_DPI / 12;
lv_style_scr.body.padding.inner = LV_DPI / 12;
lv_style_scr.body.border.color = LV_COLOR_BLACK;
lv_style_scr.body.border.opa = LV_OPA_COVER;
lv_style_scr.body.border.width = 0;
lv_style_scr.body.border.part = LV_BORDER_FULL;
新版本没有这些了,请问怎么修改主屏幕的背景色
离线
直接修改主题颜色不成功
#define LV_THEME_DEFAULT_COLOR_PRIMARY LV_COLOR_BLACK//lv_color_hex(0x01a2b1)
#define LV_THEME_DEFAULT_COLOR_SECONDARY LV_COLOR_BLACK//lv_color_hex(0x44d1b6)
离线
7.x版本已经不兼容6.x的api,用新的api lv_style_set_bg_color函数
离线
原来是这样
#define LV_THEME_DEFAULT_INIT lv_theme_mono_init
#define LV_THEME_DEFAULT_COLOR_PRIMARY LV_COLOR_WHITE//lv_color_hex(0x01a2b1)
#define LV_THEME_DEFAULT_COLOR_SECONDARY LV_COLOR_BLACK//lv_color_hex(0x44d1b6)
#define LV_THEME_DEFAULT_FLAG 0
离线
都用这么高的版本了,我还在用6呢。
离线
7比6要好用
离线
lv_style_set_bg_color函数
离线