How to set some lv_menu item's color

Just found out how to set the back button color, you should use:

lv_obj_set_style_text_color(lv_menu_get_sidebar_header_back_btn(menu), lv_color_make(0xff, 0x00, 0x00), _LV_STYLE_STATE_CMP_SAME); after lv_menu_set_sidebar_page(menu, root_page);

something like this

lv_menu_set_sidebar_page(menu, root_page);
lv_obj_set_style_text_color(lv_menu_get_sidebar_header_back_btn(menu), lv_color_make(0xff, 0x00, 0x00), _LV_STYLE_STATE_CMP_SAME);

This will set the sidebar back button to red.
imagen

1 Like