Create invisible containers/objects
What MCU/Processor/Board and compiler are you using?
Custom ESP32 with SSD1306: Mono 64x48 landscape
What LVGL version are you using?
What do you want to achieve?
I’d like to be able to divide my screen into sections and then center labels inside those sections of the screen.
What have you tried so far?
I was able to achieve this with objects but it would be nice if there were no borders as my screen area is very limited.
Code to reproduce
// Get the current screen and wipe all child objects lv_obj_t *scr = lv_scr_act(); lv_obj_clean(scr); // Divide the screen in half lv_obj_t *leftPlug = lv_obj_create(scr, NULL); lv_obj_set_size(leftPlug, 32, 48); lv_obj_t *rightPlug = lv_obj_create(scr, leftPlug); lv_obj_set_pos(rightPlug, 32, 0); // Create left plug symbols centered on the left side // Check state and display result, use dummy values for now lv_obj_t *leftTitle = lv_label_create(leftPlug, NULL); lv_label_set_text(leftTitle, "L\n" LV_SYMBOL_BATTERY_1 LV_SYMBOL_CHARGE "\n" LV_SYMBOL_DOWNLOAD LV_SYMBOL_CLOSE); lv_obj_align(leftTitle, NULL, LV_ALIGN_IN_TOP_MID, 0, 0); // Create right plug symbols centered on the right side // Check state and display result, use dummy values for now lv_obj_t *rightTitle = lv_label_create(rightPlug, NULL); lv_label_set_text(rightTitle, "R\n" LV_SYMBOL_CLOSE "\n"); lv_obj_align(rightTitle, NULL, LV_ALIGN_IN_TOP_MID, 0, 0);