How to change the background color of the basic screen

Description

I tried the different theme and it works, but I can’t change the color of basic screen,it always be WHITE background, only objects changed, how can i change the color of background? It seems that there is some special setting for screen.

What MCU/Processor/Board and compiler are you using?

STM32F103 & Keil

What do you experience?

I learned from the tutorial about changeing theme, the night theme is ok to me, so i tried the templ theme and add all the initiation code to those function, but that’s for basic objects like btn, label, liss, so which one work for screen?

What do you expect?

Changeing the background color of screen

Code to reproduce

/You code here/
lv_theme_t * th = lv_theme_templ_init(0, NULL);

/*Set the surent system theme*/
lv_theme_set_current(th);

Screenshot and/or video

Hey, I figured it out, there is a “scr” for theme structure, change it and it works.4

1 Like

Hi,
What I need change over there to get a black background?

Thanks.

Another method.

  1. create a style
  2. set the style to lv_scr_act() by lv_obj_set_style(..)

Hi Kay-Linnnn
Please tell me, &scr change it to what ?
Thank you

scr refers to an lv_style_t.


Hey,like this, chech your lv_theme_templ.c file, there is a “basic_init” function, add the detail style to scr like the screenshot shows, then it will work.