Description
Hello.
I have a calendar object living inside a container that I wish to style a little, however I have been unsuccessful in doing so.
What MCU/Processor/Board and compiler are you using?
ATM I’m using the simulator.
What LVGL version are you using?
LVGL 7.2.2
What do you want to achieve?
I want to change the text color of different parts in the calendar, the header, the date numbers, etc to different colors.
What have you tried so far?
I have used the function “lv_obj_set_style_local_text_color()” on different elements of the calendar, without successful results
Code to reproduce
Here I have code that creates the calendar and tries to style it like I want:
// Create a calendar for date selection
lv_obj_t * calendar = lv_calendar_create(container, NULL);
lv_obj_set_size(calendar, 220, 220);
lv_obj_align(calendar, NULL, LV_ALIGN_IN_TOP_LEFT, 0, 0);
//lv_obj_set_event_cb(calendar, calendar_event_cb);
lv_obj_set_style_local_text_color(calendar, LV_CALENDAR_PART_HEADER, LV_STATE_DEFAULT, lv_color_hex(0xFFFFFF));
lv_obj_set_style_local_text_color(calendar, LV_CALENDAR_PART_DAY_NAMES, LV_STATE_DEFAULT, lv_color_hex(0xFFFFFF));
However, this doesn’t change the color of the day names or the header to white.
Thanks for your help