How do you remove the padding of a page on a tabview page?


I have a number of pages on a tab. When you move left everything is ok. When you move right there is a misalignment of the pages:

I am trying to make it look like the following once the drag has finished:

What MCU/Processor/Board and compiler are you using?

Simulator and a raspberry pi zero.

What LVGL version are you using?

Latest from github (7.9.0 dev)

What do you want to achieve?

Have the pages centred.

What have you tried so far?

Paddiing of the tab and of the page:

Code to reproduce

void create_tabLights(lv_obj_t * parent)
    lv_obj_set_style_local_pad_top(parent, LV_PAGE_PART_BG , LV_STATE_DEFAULT, 0);
    lv_obj_set_style_local_pad_bottom(parent, LV_PAGE_PART_BG , LV_STATE_DEFAULT, 0);
    lv_obj_set_style_local_pad_left(parent, LV_PAGE_PART_BG , LV_STATE_DEFAULT, 0);
    lv_obj_set_style_local_pad_right(parent, LV_PAGE_PART_BG , LV_STATE_DEFAULT, 0);

    create_pageLounge(parent, 8, 5);

void create_pageLounge(lv_obj_t * parent, int x, int y)

    /*Create a page*/
	lv_obj_t * page = createPage(parent, x, y, "Lounge");
	lv_obj_set_drag_parent(page, true);

    struct objReturnVal retVal;
    retVal = createSlider(page, "Main", startPos);
    main_light = retVal.obj;
    label_inner_main_light = retVal.label;
	lv_obj_set_event_cb(main_light, lounge_main_event_cb);   /*Assign an event callback*/


lv_obj_t * createPage(lv_obj_t * parent, int x, int y, char* title)
    /*Create a page*/
    lv_obj_t * page = lv_page_create(parent, NULL);

    lv_page_glue_obj(page, true);
    lv_obj_set_size(page, 330, 220);
    lv_page_set_edge_flash(page, false);
    lv_page_set_scroll_propagation(page, true);
    lv_obj_align(page, parent, LV_ALIGN_IN_TOP_LEFT, x, y);
    //lv_obj_set_pos(page, x, y);
    //lv_obj_align(page, NULL, LV_ALIGN_CENTER, 0, 0);

    lv_obj_set_style_local_pad_top(page, LV_PAGE_PART_BG , LV_STATE_DEFAULT, 0);
    lv_obj_set_style_local_pad_bottom(page, LV_PAGE_PART_BG , LV_STATE_DEFAULT, 0);
    lv_obj_set_style_local_pad_left(page, LV_PAGE_PART_BG , LV_STATE_DEFAULT, 0);
    lv_obj_set_style_local_pad_right(page, LV_PAGE_PART_BG , LV_STATE_DEFAULT, 0);

    /*Create a label on the page*/
    lv_obj_t * label = lv_label_create(page, NULL);
    //lv_obj_set_pos(label, 10, 10);
    //lv_obj_set_width(label, lv_page_get_width_fit(page));          /*Set the label width to max value to not show hor. scroll bars*/
    lv_label_set_text(label, title);
	lv_obj_align(label, page, LV_ALIGN_IN_TOP_MID, 0, 5);

    lv_obj_set_style_local_pad_top(label, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, 0);
    lv_obj_set_style_local_pad_bottom(label, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, 0);
    lv_obj_set_style_local_pad_left(label, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, 0);
    lv_obj_set_style_local_pad_right(label, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, 0);

    return page;

Screenshot and/or video

Screenshots above

Found it!

lv_obj_set_style_local_pad_left(parent, LV_TABVIEW_PART_BG_SCROLLABLE , LV_STATE_DEFAULT, 0);
lv_obj_set_style_local_pad_right(parent, LV_TABVIEW_PART_BG_SCROLLABLE , LV_STATE_DEFAULT, 0);