How to change the background color of a page in a tabview?


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

What LVGL version are you using?


What do you want to achieve?

apply a style to a pageview to change its background color. The container of the pageview?

What have you tried so far?

I tried to apply a style lv_obj_add_style to LV_PAGE_PART_BG but didn’t change the color.

Code to reproduce

lv_style_set_bg_color(&darkbg, LV_STATE_DEFAULT, lv_color_make(0,0,0));
lv_obj_t *darkBgTab = lv_tabview_add_tab(tabView, "Dark bg");
lv_obj_add_style(darkBgTab, LV_PAGE_PART_BG, &darkbg);

Screenshot and/or video

I think the correct part to use is LV_TABVIEW_PART_BG_SCRL.

In general, it’s best to assume object parts only work with that object unless otherwise specified.

LV_TABVIEW_PART_BG_SCRL does not exist,

I found that if I apply to the parent (lv_tabview_create) it change for all, but I only want to each individually specific page.
Can I specify it individually?
or I need to add a new container to apply the style?