[How To] At Tabview ,how to set anim in the same rate when changing between tabs?


By tabview example code,
when click changing between tab1 and tab2,
at first time , it seems not animation,
at second time, it seems animation,
at third time, it seems animation time has a little more than the second time.

And then it seems occur loop like the first time again. (VDO below)

Wish any time when changing between tabs,
the animation has the same performance.

What MCU/Processor/Board

ESP32 with lastest dev 7.0 (commit 87d5c4d)

What do you want to achieve?

As description above.

What have you tried so far?

Already tried to set anim time
by. lv_tabview_set_anim_time(...),
but not worked.

Code to reproduce

Code from tabview document example

void lv_ex_tabview_1(void)
    /*Create a Tab view object*/
    lv_obj_t *tabview;
    tabview = lv_tabview_create(lv_scr_act(), NULL);

    /*Add 3 tabs (the tabs are page (lv_page) and can be scrolled*/
    lv_obj_t *tab1 = lv_tabview_add_tab(tabview, "Tab 1");
    lv_obj_t *tab2 = lv_tabview_add_tab(tabview, "Tab 2");
    lv_obj_t *tab3 = lv_tabview_add_tab(tabview, "Tab 3");

    /*Add content to the tabs*/
    lv_obj_t * label = lv_label_create(tab1, NULL);
    lv_label_set_text(label, "This the first tab\n\n"
                             "If the content\n"
                             "of a tab\n"
                             "become too long\n"
                             "the it \n"

    label = lv_label_create(tab2, NULL);
    lv_label_set_text(label, "Second tab");

    label = lv_label_create(tab3, NULL);
    lv_label_set_text(label, "Third tab");

Screenshot and/or video

video link

Looks like a bug (there appears to be no animation for the first few slides).

1 Like

I’ve fixed a few days ago. Please try the latest version.

1 Like