I want to switch screen to display two different screen,like mainUI with button “setup”,and when I clicked the button,it jump to settingUI.
I found when running function “lv_obj_clean”, the littlevgl will clean the screen first that causing the display flash.
How to solve it or other way to avoid it.
my code:
void main(void)
{
hres = lv_disp_get_hor_res(NULL);
vres = lv_disp_get_ver_res(NULL);
baseObj = lv_obj_create(lv_scr_act(), NULL);
lv_obj_set_size(baseObj, hres, vres);
lv_obj_set_pos(baseObj,0,0);
mainUI();
}
void mainUI(void)
{
if(lv_obj_get_child(baseObj,NULL))
lv_obj_clean(baseObj);
lv_obj_t* img = lv_img_create(baseObj,NULL);
lv_img_set_src(img, &mainMenu);
}
void settingUI(void)
{
if(lv_obj_get_child(baseObj,NULL))
lv_obj_clean(baseObj);
lv_obj_t* img = lv_img_create(baseObj,NULL);
lv_img_set_src(img, &mainMenu);
}