Background Color

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Background Color

跳至解决方案
4,434 次查看
Jeannot
Contributor II

Gui Guider Version: 1.2.1-GA // Windows 10

I'm able to edit the source code to a given background color via "lv_obj_set_style_local_bg_color", but I can't in the application itself. How do I edit the background color in Gui Guider? I don't see a widget or setting to address this in the application. 

0 项奖励
1 解答
4,410 次查看
zhenhualuo
NXP Employee
NXP Employee

Hi,

The background of screen can't be set by GUI Guider, we will add the function in next release (v1.3.0). Currently you can manually add the code in custom.c of application to change screen background, you can also use container or image widget to implement the effect in the UI editor.

 

Best Regards,

Zhenhua

在原帖中查看解决方案

6 回复数
4,258 次查看
gertvb
Contributor III

Good day!

Im still working with GUIGuider1.1 and used the following approach to set the screen's background

Ive created a new style, set its background, and added the style to the screen defined by GUIGuider.

Attached the code as in the screen definition file created by GUIGuider.

void setup_scr_scr_info(lv_ui *ui){

//Write codes scr_info
ui->scr_info = lv_obj_create(NULL, NULL);

//GvB added to set screen background to dark green : begin.....
static lv_style_t style_scr_info;
lv_style_set_bg_color(&style_scr_info, LV_STATE_DEFAULT, lv_color_hex(0x008800));
lv_obj_add_style(ui->scr_info, LV_OBJ_PART_MAIN, &style_scr_info);

//GvB added to set screen background end.....

//Write codes scr_info_btn_Settings
ui->scr_info_btn_Settings = lv_btn_create(ui->scr_info, NULL);

//Write style LV_BTN_PART_MAIN for scr_info_btn_Settings
static lv_style_t style_scr_info_btn_Settings_main;
lv_style_init(&style_scr_info_btn_Settings_main);

 

A TechExplorer working with Embedded Software and Electronics in Agriculture and Alternative Energy
4,240 次查看
Jeannot
Contributor II

Thanks so much!

0 项奖励
4,415 次查看
Jeannot
Contributor II

I'm not talking about the widgets themselves, that's clear. What I'm after is a global color setting for the screen background itself. This is a line in the source code, see reference above. By default it's transparent in Guider, and can only be changed with code and seen via simulator or hardware. 

0 项奖励
4,411 次查看
zhenhualuo
NXP Employee
NXP Employee

Hi,

The background of screen can't be set by GUI Guider, we will add the function in next release (v1.3.0). Currently you can manually add the code in custom.c of application to change screen background, you can also use container or image widget to implement the effect in the UI editor.

 

Best Regards,

Zhenhua

4,393 次查看
Jeannot
Contributor II

Thank you!

0 项奖励
4,427 次查看
zhenhualuo
NXP Employee
NXP Employee

Hi, 

The background color can be configured in GUI Guider, you will see the background setting when a widget is selected in the UI editor.  

zhenhualuo_0-1633663858974.png

 

Best Regards,

Zhenhua 

0 项奖励