lv_tabview.h
API reference for lv_tabview.h
Functions
lv_tabview_set_tab_text
Change the name of the tab
void lv_tabview_set_tab_text(lv_obj_t *obj, uint32_t idx, const char *new_name)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a tabview widget |
idx | uint32_t | the index of the tab to rename |
new_name | const char * | the new name as a string May be NULL. When NULL the current name is kept and only refreshed, see lv_label_set_text. |
lv_tabview_set_tab_translation_tag
Add a tab to the tabview whose label is bound to a translation tag. The tab bar shows the translation of tag for the currently selected language, and updates automatically on lv_translation_set_language(). If no language is selected or the tag is not found in any translation pack, the tag itself is displayed.
lv_obj_t * lv_tabview_set_tab_translation_tag(lv_obj_t *obj, const char *tag)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a tabview widget |
tag | const char * | '\0' terminated translation key, must be non-NULL and not empty. |
Returns: lv_obj_t * — the widget where the content of the tab can be created
lv_tabview_set_active
Show a tab
void lv_tabview_set_active(lv_obj_t *obj, uint32_t idx, lv_anim_enable_t anim_en)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a tabview widget |
idx | uint32_t | the index of the tab to show |
anim_en | lv_anim_enable_t | LV_ANIM_ON/OFF |
lv_tabview_set_tab_bar_position
Set the position of the tab bar
void lv_tabview_set_tab_bar_position(lv_obj_t *obj, lv_dir_t dir)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a tabview widget |
dir | lv_dir_t | LV_DIR_TOP/BOTTOM/LEFT/RIGHT |
lv_tabview_set_tab_bar_size
Set the width or height of the tab bar
void lv_tabview_set_tab_bar_size(lv_obj_t *obj, int32_t size)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to tabview widget |
size | int32_t | size of the tab bar in pixels or percentage. will be used as width or height based on the position of the tab bar) |
lv_tabview_get_tab_count
Get the number of tabs
uint32_t lv_tabview_get_tab_count(lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a tabview widget |
Returns: uint32_t — the number of tabs
lv_tabview_get_tab_active
Get the current tab's index
uint32_t lv_tabview_get_tab_active(lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a tabview widget |
Returns: uint32_t — the zero based index of the current tab
lv_tabview_get_tab_button
Get a given tab button by index
lv_obj_t * lv_tabview_get_tab_button(lv_obj_t *obj, int32_t idx)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a tabview widget |
idx | int32_t | zero based index of the tab button to get. < 0 means start counting tab button from the back (-1 is the last tab button) |
Returns: lv_obj_t * — pointer to the tab button, or NULL if the index was out of range
lv_tabview_get_content
Get the widget where the container of each tab is created
lv_obj_t * lv_tabview_get_content(lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a tabview widget |
Returns: lv_obj_t * — the main container widget
lv_tabview_get_tab_bar
Get the tab bar where the buttons are created
lv_obj_t * lv_tabview_get_tab_bar(lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a tabview widget |
Returns: lv_obj_t * — the tab bar
lv_tabview_get_tab_bar_position
Get the position of the tab bar
lv_dir_t lv_tabview_get_tab_bar_position(lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a tabview widget |
Returns: lv_dir_t — LV_DIR_TOP/BOTTOM/LEFT/RIGHT
lv_tabview_create
Create a tabview widget
lv_obj_t * lv_tabview_create(lv_obj_t *parent)| Name | Type | Description |
|---|---|---|
parent | lv_obj_t * | pointer to a parent widget May be NULL.. When NULL, the widget is created as a screen on the default display. |
Returns: lv_obj_t * — the created tabview
lv_tabview_add_tab
Add a tab to the tabview
lv_obj_t * lv_tabview_add_tab(lv_obj_t *obj, const char *name)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a tabview widget |
name | const char * | the name of the tab to be displayed on the tab bar May be NULL. When NULL the tab button's label keeps the default label text (LV_LABEL_DEFAULT_TEXT). Useful when the text is set later, e.g. via a translation tag. |
Returns: lv_obj_t * — the widget where the content of the tab can be created
Enums
_lv_property_tabview_id_t
| Name | Value |
|---|---|
LV_PROPERTY_TABVIEW_TAB_ACTIVE | (LV_PROPERTY_TABVIEW_START + ((int) 0 )) | (( 1 ) << 28 ) |
LV_PROPERTY_TABVIEW_TAB_BAR_POSITION | (LV_PROPERTY_TABVIEW_START + ((int) 1 )) | (( 1 ) << 28 ) |
LV_PROPERTY_TABVIEW_END |
Variables
lv_tabview_class
const lv_obj_class_t lv_tabview_classDependencies
Indirect dependencies
lv_anim.hlv_area.hlv_assert.hlv_bidi.hlv_color.hlv_color_op.hlv_display.hlv_draw.hlv_draw_arc.hlv_draw_blur.hlv_draw_buf.hlv_draw_image.hlv_draw_label.hlv_draw_line.hlv_draw_rect.hlv_draw_triangle.hlv_event.hlv_ext_data.hlv_flex.hlv_font.hlv_fs.hlv_grad.hlv_grid.hlv_group.hlv_image_decoder.hlv_image_dsc.hlv_indev.hlv_layout.hlv_log.hlv_math.hlv_matrix.hlv_mem.hlv_obj_class.hlv_obj_draw.hlv_obj_event.hlv_obj_pos.hlv_obj_scroll.hlv_obj_style.hlv_obj_style_gen.hlv_obj_tree.hlv_palette.hlv_profiler.hlv_profiler_builtin.hlv_sprintf.hlv_string.hlv_style.hlv_style_gen.hlv_symbol_def.hlv_text.hlv_timer.hlv_types.h
Last updated on