How do I change the animation speed in tabview. Instead of the slow sliding animation, I would like it to change fast - it doesn’t even need to slide. Just a fast change.
What MCU/Processor/Board and compiler are you using?
ESP32 with arduino on a 480x320 display
What LVGL version are you using?
8.3.7
What do you want to achieve?
Change the animation speed when a tab button is changed
What have you tried so far?
Seen how it´s done in version 7, but that doesn’t work anymore
I get where you are going with your example.
When you attach the event handler for tabView you forget to send the content.
I have been trying this, but still no success
lv_obj_t* tabView = lv_tabview_create(myScreen, LV_DIR_TOP, 30);
lv_obj_add_event_cb(tabView, CbScrollBeginEvent, LV_EVENT_SCROLL_BEGIN, lv_tabview_get_content(tabView));
lv_obj_t* tab1 = lv_tabview_add_tab(tabView, "Tab1");
lv_obj_t* tab2 = lv_tabview_add_tab(tabView, "Tab2");
static void CbScrollBeginEvent(lv_event_t* e)
{
/*Disable the scroll animations. Triggered when a tab button is clicked */
if (lv_event_get_code(e) == LV_EVENT_SCROLL_BEGIN) {
lv_anim_t* a = (lv_anim_t*)lv_event_get_param(e);
if (a)
a->time = 0;
}
}