Description
May I ask you to help me with an object alignment? It seems I miss something important.
I try to use padding to create gaps between objects and between an object and a screen border.
I already tried many combination but the result is still the same - NO GAP. Unfortunately I did not find any example how to use it. I know it is possible to set offset of the alignment but I would like to use padding (or margin) because it can be constant for all objects independently on the alignment type (LEFT, MID, RIGHT)
What MCU/Processor/Board and compiler are you using?
ttgo watch + PlatformIO
What LVGL version are you using?
7.3.1
Code to reproduce
lv_obj_t * container = lv_obj_create( lv_scr_act(), NULL );
lv_obj_set_size(container, 240, 240);
lv_obj_set_style_local_pad_inner( container, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, 10 );
lv_obj_align(container, NULL, LV_ALIGN_IN_TOP_LEFT, 0, 0);
lv_obj_t *btn1 = lv_btn_create(container, NULL);
lv_obj_align(btn1, NULL, LV_ALIGN_IN_TOP_LEFT, 0, 0);
lv_obj_t *btn2 = lv_btn_create(container, NULL);
lv_obj_set_style_local_pad_left(btn2, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, 10 );
lv_obj_set_style_local_pad_top(btn2, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, 10 );
lv_obj_align(btn2, btn1, LV_ALIGN_OUT_BOTTOM_MID, 0, 0);