Description
I cannot create a customized tabview with text left aligned and user defined icons (see screenshot)
What MCU/Processor/Board and compiler are you using?
I use LVGL simulator for windows version 8.3
What LVGL version are you using?
Version 8.3 (the version is fix for my project!)
What do you want to achieve?
see screenshot: the text of the buttons should be left assigned and user defined icons should be displayed
Icon example
What have you tried so far?
I use the simulator with verison 8.3 and the example project “lv_example_tabview_2”.
I’ve tried several things:
- setting the text style immidiately after creating the tabview
- setting the text style after all initializations for the tabview
- creating a label for every tab button, but here I don’t know how to access every single tab button (maybe this could be a workaround if I can access every single tab button)
lv_obj_t * tabview;
tabview = lv_tabview_create(lv_scr_act(), LV_DIR_LEFT, 200);
lv_obj_t * tab_btns = lv_tabview_get_tab_btns(tabview);
lv_obj_set_style_text_align(tab_btns, LV_TEXT_ALIGN_LEFT, LV_PART_ITEMS | LV_STATE_DEFAULT);
static lv_style_t style_tab_btns;
lv_style_init(&style_tab_btns);
lv_style_set_text_align(&style_tab_btns, LV_TEXT_ALIGN_LEFT);
lv_obj_add_style(tab_btns, &style_tab_btns, 0);