I found the problem of LVGL V.8.1 cannot add style to the list of drop-down list widget but on V7.11 work fine(by using selector is LV_DROPDOWN_PART_LIST but on V8.1 it is not available for this selector).
What MCU/Processor/Board and compiler are you using?
TI, Embedded Linux and Eclipse
What LVGL version are you using?
8.1
What do you want to achieve?
I would like to change the style(like a font, text color) in the list of drop-down when clicked it.
What have you tried so far?
I have tried to use lv_obj_add_style(dropdownobject, &styleNew, LV_STATE_PRESSED / LV_PART_MAIN or etc. ); but do not work any more in the list of drop down.
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:
/*You code here*/
Screenshot and/or video
If possible, add screenshots and/or videos about the current state.
I have solved this issue by using as below to change a new style of the list of dropdown list widget.
lv_obj_t * list = lv_dropdown_get_list(dropdown) /Get the list/
lv_obj_add_style(list, &my_style, …) /Add the styles to the list/}
lv_obj_t * list = lv_dropdown_get_list(dropdown) /Get the list /
lv_obj_add_style(list, &my_style, …) /Add the styles to the list /}
This method adds the same style to all drop down list items.
I mean, for example, there is a text drop down list and I want that each element of the list to be a different color. If it’s not difficult, you could give an example of how this can be implemented.
The problem is that in the text drop down list, all its elements are represented as a single label.