Description
Hi kisvegabor,
We are facing an issue while switching the two screens.
I have 2 screens when i redirect the screen from screen 1 to screen 2 some unknown objects are showing in the second screen.
I don’t know from where these objects are coming.
Please see the screenshot attached.
In below screen shot text area is showing at top left corner and my two text areas below the “Hello, Please login Here” are not showing.
What MCU/Processor/Board and compiler are you using?
ARM
What LVGL version are you using?
Version 7
What do you want to achieve?
I want to show the screen what i have written.
What have you tried so far?
lv_obj_t *prev_scr=lv_scr_act();
lv_obj_t * curr_scr=lv_obj_create(NULL,NULL);
lv_scr_load(curr_scr);
lv_obj_del(prev_scr);
//Added these lines in every screen but not worked .
Code to reproduce
Screen 1:
void iotgizmo_wifi(void)
{
lv_obj_t *prev_scr=lv_scr_act();
lv_obj_t * curr_scr=lv_obj_create(NULL,NULL);
lv_scr_load(curr_scr);
lv_obj_del(prev_scr);
#if LV_IOTGIZMO_WALLPAPER
lv_obj_t * wp = lv_img_create(lv_scr_act(), NULL);
lv_img_set_src(wp, &final_bg);
lv_obj_set_click(wp, true);
#endif
//logo
lv_obj_t * logo_title = lv_img_create(lv_scr_act(), NULL);
lv_img_set_src(logo_title, &logo);
lv_obj_align(logo_title, NULL, LV_ALIGN_IN_TOP_MID, 0, 120);
lv_obj_add_style(logo_title, LV_OBJ_PART_MAIN, &style_border);
//label
lv_obj_t * label_txt;
label_txt = lv_label_create(lv_scr_act(),NULL);
lv_label_set_recolor(label_txt,true);
lv_label_set_text(label_txt, "#FFFFFF Please Enter WIFI Details Here.");
lv_obj_set_width(label_txt, 150);
lv_obj_align(label_txt, logo_title, LV_ALIGN_CENTER, 0, 100);
//textarea_ssid
ssid= lv_textarea_create(lv_scr_act(), NULL);
lv_obj_set_size(ssid, 300, 100);
lv_obj_align(ssid, label_txt, LV_ALIGN_CENTER, 0, 100);
lv_textarea_set_text(ssid, "ssid");
lv_textarea_set_one_line(ssid, true);
lv_textarea_set_cursor_hidden(ssid, true);
lv_textarea_set_placeholder_text(ssid, "SSID");
// lv_obj_set_event_cb(ssid, ta_event_cb);
lv_textarea_set_text_sel(ssid, true);
//textarea_password
password= lv_textarea_create(lv_scr_act(), NULL);
lv_obj_set_size(password, 300, 100);
lv_obj_align(password, ssid, LV_ALIGN_CENTER, 0, 100);
lv_textarea_set_text(password, "password");
lv_textarea_set_pwd_mode(password,true);
lv_textarea_set_one_line(password, true);
lv_textarea_set_cursor_hidden(password, true);
lv_textarea_set_placeholder_text(password, "Password");
// lv_obj_set_event_cb(password, ta_event_cb);
//button
lv_obj_t * label;
lv_obj_t * cnt_btn = lv_btn_create(lv_scr_act(), NULL);
lv_obj_set_event_cb(cnt_btn, event_handler);
lv_obj_align(cnt_btn, NULL, LV_ALIGN_CENTER, 0, 100);
label = lv_label_create(cnt_btn, NULL);
lv_label_set_text(label, "Connect");
//Keyboard
keyboard = lv_keyboard_create(lv_scr_act(), NULL);
lv_obj_set_size(keyboard,480,250);
lv_keyboard_set_textarea(keyboard, ssid);
lv_keyboard_set_cursor_manage(keyboard, true);
lv_obj_align(keyboard, NULL, LV_ALIGN_IN_BOTTOM_MID, 0, 0);
}
Screen 2:
void iotgizmo_login(void)
{
lv_obj_t *prev_scr=lv_scr_act();
lv_obj_t * curr_scr=lv_obj_create(NULL,NULL);
lv_scr_load(curr_scr);
lv_obj_del(prev_scr);
#if LV_IOTGIZMO_WALLPAPER
lv_obj_t * wp = lv_img_create(lv_scr_act(), NULL);
lv_img_set_src(wp, &final_bg);
lv_obj_set_click(wp, true);
#endif
//loader
loader=lv_spinner_create(lv_scr_act(),NULL);
lv_obj_set_size(loader,75,75);
lv_obj_set_hidden(loader,true);
lv_obj_align(loader,NULL,LV_ALIGN_IN_TOP_MID,0,20);
//logo
logo_title = lv_img_create(lv_scr_act(), NULL);
lv_img_set_src(logo_title, &logo);
lv_obj_align(logo_title,loader, LV_ALIGN_OUT_BOTTOM_MID, 0, 50);
//label
lv_obj_t * label_txt;
label_txt = lv_label_create(lv_scr_act(),NULL);
lv_label_set_recolor(label_txt, true);
lv_label_set_text(label_txt, " #FFFFFF Hello, Please Login Here.");
lv_obj_set_width(label_txt, 150);
lv_obj_align(label_txt, logo_title, LV_ALIGN_CENTER, 0, 100);
//textarea
email= lv_textarea_create(lv_scr_act(), NULL);
lv_obj_set_size(email, 300, 100);
lv_obj_align(email, label_txt, LV_ALIGN_CENTER, 0, 100);
lv_textarea_set_text(email, "test@gmail.com");
lv_textarea_set_one_line(email, true);
lv_textarea_set_cursor_hidden(email, true);
lv_textarea_set_placeholder_text(email, "Email");
// lv_obj_set_event_cb(email, ta_event_cb);
lv_textarea_set_text_sel(email, true);
password= lv_textarea_create(lv_scr_act(), NULL);
lv_obj_set_size(password, 300, 100);
lv_obj_align(password, email, LV_ALIGN_CENTER, 0, 100);
lv_textarea_set_text(password, "password");
lv_textarea_set_one_line(password, true);
lv_textarea_set_cursor_hidden(password, true);
lv_textarea_set_placeholder_text(password, "Password");
// lv_obj_set_event_cb(password, ta_event_cb);
//button
lv_obj_t * label;
lv_obj_t * lgn_btn = lv_btn_create(lv_scr_act(), NULL);
lv_obj_set_event_cb(lgn_btn, event_handler);
lv_obj_align(lgn_btn, NULL, LV_ALIGN_CENTER, 0, 100);
label = lv_label_create(lgn_btn, NULL);
lv_label_set_text(label, "Login");
//Keyboard
keyboard = lv_keyboard_create(lv_scr_act(), NULL);
lv_obj_set_size(keyboard,480,250);
lv_keyboard_set_textarea(keyboard, email);
lv_keyboard_set_cursor_manage(keyboard, true);
lv_obj_align(keyboard, NULL, LV_ALIGN_IN_BOTTOM_MID, 0, 0);
}