Description
I want to employ a tabview with the LV_DIR_LEFT direction to present tabs in a menu-like list. However, I’m encountering a challenge where I cannot align the titles to the left within the button matrix. The text is automatically centered in the virtual buttons (see screenshot bellow), and I’m looking for a way to customize the alignment to achieve a left-aligned presentation.
What MCU/Processor/Board and compiler are you using?
vscode simulator
What LVGL version are you using?
LVGL 8.3.7
What have you tried so far?
lv_obj_set_style_text_align(lv_tabview_get_tab_btns(tabview),LV_TEXT_ALIGN_LEFT,LV_PART_ITEMS| LV_STATE_DEFAULT);
Code to reproduce
Add a code snippet which can run in the simulator. It should contain only the relevant code that compiles without errors when separated from your main code base.
The code block(s) should be formatted like:
lv_obj_t *tabview = lv_tabview_create(screen,LV_DIR_LEFT,200);
lv_tabview_add_tab(tabview,"\thello\t");
lv_tabview_add_tab(tabview, "\they you" );
lv_tabview_add_tab(tabview, "\thello world");
lv_tabview_add_tab(tabview, "\tfourth page");
lv_tabview_add_tab(tabview, "\tHome");