/* Tab bar size depends on position */
/* TOP/BOTTOM: size = height */
lv_tabview_set_tab_bar_position(tabview, LV_DIR_TOP);
lv_tabview_set_tab_bar_size(tabview, 80); /* 80px height */
/* Content: 480 x (320 - 80) = 480 x 240 */
/* LEFT/RIGHT: size = width */
lv_tabview_set_tab_bar_position(tabview, LV_DIR_LEFT);
lv_tabview_set_tab_bar_size(tabview, 80); /* 80px width */
/* Content: (480 - 80) x 320 = 400 x 320 */
/* Widgets created in tab use the TAB as parent */
void create_tab_content(lv_obj_t * tab_parent)
{
/* tab_parent is the container returned by lv_tabview_add_tab() */
lv_obj_t * widget = lv_label_create(tab_parent); /* NOT lv_screen_active() */
}
lv_obj_t * tab_btns = lv_tabview_get_tab_bar(tabview);
/* Background color */
lv_obj_set_style_bg_color(tab_btns,
lv_palette_darken(LV_PALETTE_GREY, 3), 0);
/* Text color */
lv_obj_set_style_text_color(tab_btns,
lv_palette_lighten(LV_PALETTE_GREY, 5), 0);
/* Active tab indicator */
lv_obj_set_style_border_side(tab_btns,
LV_BORDER_SIDE_TOP,
LV_PART_ITEMS | LV_STATE_CHECKED);