The page I exported with the "guide" code becomes white after adding "guide" to it.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

The page I exported with the "guide" code becomes white after adding "guide" to it.

1,211 Views
qqt_996
Contributor I

The page I exported using the "gui guide" code will turn white after adding group, and the page cannot be loaded. It is added in "setup_scr_screen";
lv_group_t *group = lv_group_create();
lv_group_add_obj(group, ui->BootPage_btn_1);
lv_group_add_obj(group, ui->BootPage_btn_2);
lv_indev_set_group(keypadIndevice, group);

0 Kudos
Reply
9 Replies

1,180 Views
Harry_Zhang
NXP Employee
NXP Employee

Hi @qqt_996 

Here’s a checklist and potential solutions:
Checklist:
1. Ensure Proper Initialization: Make sure that keypadIndevice is properly initialized before it is used with lv_indev_set_group().
2. Group Creation and Association: Verify that lv_group_create() is called before any objects are added to the group using lv_group_add_obj(). Ensure that the objects (ui->BootPage_btn_1, ui->BootPage_btn_2) are valid and already initialized.
3. Input Device Setup: Confirm that the keypadIndevice is correctly set up with lv_indev_set_group(). The device should be initialized to capture inputs (e.g., keypad or encoder) and be correctly assigned to the group.
4. Check Memory Issues: If the screen turns white, it might be due to memory corruption or overflow. Ensure that there is sufficient memory allocated for objects, groups, and other GUI elements.
5. Debugging LVGL Events: Enable LVGL logging (LV_USE_LOG) to capture logs that might provide insights into what’s happening when the screen turns white.
6. Screen Re-draw: Make sure that the screen is properly redrawn after the group is created and objects are added. Sometimes forcing a redraw can help resolve the display issue.

BR

Hang

0 Kudos
Reply

1,076 Views
qqt_996
Contributor I
Hello, I successfully set the default focus in v8.3.10, but the control style has not changed. Is there any way to solve it?
0 Kudos
Reply

1,044 Views
Harry_Zhang
NXP Employee
NXP Employee

Hi @qqt_996 

Can you describe the problem in detail? Or can you upload pictures?

BR

Hang

0 Kudos
Reply

1,008 Views
qqt_996
Contributor I
are you still there ??
0 Kudos
Reply

1,039 Views
qqt_996
Contributor I

lv_group_t* group= lv_group_create();
lv_group_add_obj(group, ui->Parameters_list_1_item0);
lv_group_add_obj(group, ui->Parameters_list_1_item1);
lv_indev_set_group(keypadIndevice, group);
lv_group_focus_obj(ui->Parameters_list_1_item0);

 

Setting focus through lv_group_focus_obj, the control successfully sets focus, but the style does not change。

iwEcAqNqcGcDAQTRA8AF0QUABrAmi9wqKwG3DAbSsWAcqO8AB9IfD8nUCAAJomltCgAL0gAB_18.jpg_720x720q90.jpg

0 Kudos
Reply

997 Views
Harry_Zhang
NXP Employee
NXP Employee

Hi @qqt_996 

Here are a few things to check:
1. Ensure Styles are Defined for Focused State: Make sure you have defined a style that should be applied when the object is focused. Typically, you need to set styles for the LV_STATE_FOCUSED state on the object. For example:
lv_obj_t * obj = lv_obj_create(parent);
lv_style_t style_focused;
lv_style_init(&style_focused);
lv_style_set_bg_color(&style_focused, lv_color_hex(0xFF0000)); // Example: red background when focused
lv_obj_add_style(obj, &style_focused, LV_STATE_FOCUSED);

2. Check Group Focus Callbacks: Ensure that your object’s styles are being properly updated when the object is focused. LVGL might have a callback mechanism that needs to be properly set up to update the style when the focus changes.
lv_group_set_focus_cb(group, focus_cb);
void focus_cb(lv_group_t * group)
{
lv_obj_t * focused_obj = lv_group_get_focused(group);
// Update style or handle the focused state here
}

3. Ensure the UI Theme Does Not Override Styles: If you’re using a theme, it might be overriding your style settings.

BR

Hang

0 Kudos
Reply

984 Views
qqt_996
Contributor I
This method does not work
0 Kudos
Reply

987 Views
qqt_996
Contributor I
Isn't there a default style when setting focus? No need to set a separate style
0 Kudos
Reply

925 Views
Harry_Zhang
NXP Employee
NXP Employee

Hi @qqt_996 

May I ask what chip you are using? Can you share the project with me?

BR

Hang

0 Kudos
Reply