Description
I want to bottom align a button on a tabview without showing the scrollbar.
What MCU/Processor/Board and compiler are you using?
ESP32 / ILI9341 / PlatformIO
What LVGL version are you using?
7.8.1
What do you want to achieve?
I want to be able to bottom left/right align the proper lvgl way without seeing scrollbars
What have you tried so far?
- Trying to understand containers, but as far as I can see it does not support bottom allign.
- I could offset the x/y with some value while calling the align function like 15px but that seems like a hack.
Code to reproduce
void demo_create(void) {
lv_obj_t* tabview = lv_tabview_create(lv_scr_act(), NULL);
lv_obj_t* tab1 = lv_tabview_add_tab(tabview, "Tab");
lv_obj_t * label;
lv_obj_t* btn1 = lv_btn_create(tab1, NULL);
label = lv_label_create(btn1, NULL);
lv_obj_set_width(btn1, 90);
lv_label_set_text(label, "Left");
lv_obj_t* btn2 = lv_btn_create(tab1, btn1);
label = lv_label_create(btn2, NULL);
lv_label_set_text(label, "Right");
lv_obj_align(btn1, tab1, LV_ALIGN_IN_BOTTOM_LEFT, 0, 0);
lv_obj_align(btn2, tab1, LV_ALIGN_IN_BOTTOM_RIGHT, 0, 0);
}
It looks like that LV_ALIGN_IN_XXX
for tabview ignores any padding and this the tabview shows the scrollbar because it things an object is outside.