lv_tabview.h

Functions

lv_obj_t *lv_tabview_create(lv_obj_t *parent)

Create a tabview widget

Parameters:

parent -- pointer to a parent widget

Returns:

the created tabview

lv_obj_t *lv_tabview_add_tab(lv_obj_t *obj, const char *name)

Add a tab to the tabview

Parameters:
  • obj -- pointer to a tabview widget

  • name -- the name of the tab, it will be displayed on the tab bar

Returns:

the widget where the content of the tab can be created

void lv_tabview_rename_tab(lv_obj_t *obj, uint32_t idx, const char *new_name)

Change the name of the tab

Parameters:
  • obj -- pointer to a tabview widget

  • idx -- the index of the tab to rename

  • new_name -- the new name as a string

void lv_tabview_set_active(lv_obj_t *obj, uint32_t idx, lv_anim_enable_t anim_en)

Show a tab

Parameters:
  • obj -- pointer to a tabview widget

  • idx -- the index of the tab to show

  • anim_en -- LV_ANIM_ON/OFF

void lv_tabview_set_tab_bar_position(lv_obj_t *obj, lv_dir_t dir)

Set the position of the tab bar

Parameters:
  • obj -- pointer to a tabview widget

  • dir -- LV_DIR_TOP/BOTTOM/LEFT/RIGHT

void lv_tabview_set_tab_bar_size(lv_obj_t *obj, int32_t size)

Set the width or height of the tab bar

Parameters:
  • obj -- pointer to tabview widget

  • size -- size of the tab bar in pixels or percentage. will be used as width or height based on the position of the tab bar)

uint32_t lv_tabview_get_tab_count(lv_obj_t *obj)

Get the number of tabs

Parameters:

obj -- pointer to a tabview widget

Returns:

the number of tabs

uint32_t lv_tabview_get_tab_active(lv_obj_t *obj)

Get the current tab's index

Parameters:

obj -- pointer to a tabview widget

Returns:

the zero based index of the current tab

lv_obj_t *lv_tabview_get_content(lv_obj_t *obj)

Get the widget where the container of each tab is created

Parameters:

obj -- pointer to a tabview widget

Returns:

the main container widget

lv_obj_t *lv_tabview_get_tab_bar(lv_obj_t *obj)

Get the tab bar where the buttons are created

Parameters:

obj -- pointer to a tabview widget

Returns:

the tab bar

Variables

const lv_obj_class_t lv_tabview_class