/**
* Create a menu from a drop-down list and show some drop-down list features and styling
*/staticvoidlv_example_dropdown_3(void){/*Create a drop down list*/lv_obj_t* dropdown =lv_dropdown_create(lv_scr_act());// 创建dropdown对象lv_obj_align(dropdown, LV_ALIGN_TOP_LEFT,10,10);//LV_ALIGN_TOP_LEFT方式对齐lv_dropdown_set_options(dropdown,"New project\n""New file\n""Save\n""Save as ...\n""Open project\n""Recent projects\n""Preferences\n""Exit");// 设置选项内容/*Set a fixed text to display on the button of the drop-down list*/lv_dropdown_set_text(dropdown,"Menu");// 设置固定文本Menu/*Use a custom image as down icon and flip it when the list is opened*/LV_IMG_DECLARE(img_caret_down)//img_caret_down图片资源声明lv_dropdown_set_symbol(dropdown,&img_caret_down);// 设置dropdown符号lv_obj_set_style_transform_angle(dropdown,1800, LV_PART_INDICATOR | LV_STATE_CHECKED);// LV_PART_INDICATOR 和 LV_STATE_CHECKED属性时图片旋转180度/*In a menu we don't need to show the last clicked item*/lv_dropdown_set_selected_highlight(dropdown, false);//选中项关闭高亮显示lv_obj_add_event_cb(dropdown, event_cb, LV_EVENT_VALUE_CHANGED,NULL);//dropdown添加LV_EVENT_VALUE_CHANGED画件}