What is the "Hidden" flag used for?

What do you want to achieve?

I have a single screen project and just want to hide certain image labels with a condition in the Arduino code.

What have you tried so far?

Do i need the hidden flag checked? when i do it still doesn’t work , or am i using the wrong command?
see below:
/*void showIndecatorOn(bool isOn)
{
if (isOn) {
if (lv_obj_has_flag(ui_turn_on, LV_OBJ_FLAG_HIDDEN))
lv_obj_clear_flag(ui_turn_on, LV_OBJ_FLAG_HIDDEN);
} else {
if (!lv_obj_has_flag(ui_turn_on, LV_OBJ_FLAG_HIDDEN)) {
lv_obj_add_flag(ui_turn_on, LV_OBJ_FLAG_HIDDEN);
}
} ### Screenshot or video

Others

  • SquareLine Studio version:
  • Operating system:
  • Target hardware:

I guess you don’t need to check flag, just add or clear Hidden flag based on your isOn statement

1 Like

I just use lv_obj_set_flag and lv_obj_clear_flag, I use them to add or remove the lightning bolt above the battery when it is being charged and remove it when it is not.

lv_obj_add_flag(ui_turn_on, LV_OBJ_FLAG_HIDDEN);

1 Like