lv_obj_t* cont =lv_obj_create(lv_scr_act());lv_obj_set_flex_flow(cont, LV_FLEX_FLOW_ROW_WRAP);lv_obj_set_size(cont,160,180);lv_obj_set_flex_align(cont, LV_FLEX_ALIGN_SPACE_BETWEEN, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);lv_obj_set_style_base_dir(cont, LV_BASE_DIR_R...
参照父对象对齐:lv_obj_set_align(obj, LV_ALIGN_...);参照父对象对齐后再设置坐标位置:lv_obj_align(obj, LV_ALIGN_...,x,y);参照另一个对象(无父子关系)对齐后设置坐标位置:lv_obj_align_to(obj_to_align,obj_referece, LV_ALIGN_...,x,y) 4.4.1 对齐类型(LV_ALIGN_...) 五、基础对象的...
void lv_ex_btn_1(void) { lv_obj_t * label; lv_obj_t * btn1 = lv_btn_create(lv_scr_act(), NULL); lv_obj_set_event_cb(btn1, event_handler); lv_obj_align(btn1, NULL, LV_ALIGN_CENTER, 0, -40); label = lv_label_create(btn1, NULL); lv_label_set_text(label, "Button...
style_text_color(lv_scr_act(), lv_color_hex(0xffffff), LV_PART_MAIN); lv_obj_align...
lv_dropdown_set_options(dd, "Apple " "Banana " "Orange " "Cherry " "Grape " "Raspberry " "Melon " "Orange " "Lemon " "Nuts"); lv_obj_align(dd, LV_ALIGN_TOP_MID, 0, 20); lv_obj_add_event_cb(dd, event_handler, LV_EVENT_ALL, NULL); ...
参考网上移植方法修改lcd对接lvgl的驱动显示接口文件lv_port_disp_xxxl.c。 void lv_port_disp_init(void) { /*--- * Initialize your display * ---*/ disp_init(); /*--- * Create a buffer for drawing *---*/ /* LVGL requires a buffer where it draws the objects. The...
使用lv_img_set_src绘制图片 遇到一个问题,这么使用图片对象就可以 lv_img_set_src(ui->main_screen_img_2, &_3_alpha_100x100); 通过这种方式传递过来就不行 void setup_scr_main_screen(lv_ui *ui,lv_img_dsc_t alpha) 会报 Guru Meditation Error: Core 1 panic'ed (LoadProhibited). Exception ...
obj.align(lvgl.ALIGN.type,x,y) obj.set_align(lvgl.ALIGN.type) 如果设置居中,有快捷接口obj.center() LVGL支持的对齐方式见下图: 例如,以下代码会将对象从其父对象的中心移动 10(x),20(y) 像素: importlvglaslv obj=lv.obj(lv.scr_act())obj.set_align(lv.ALIGN.CENTER);obj.set_pos(10,20);...
lv_obj_t * bar = lv_bar_create(parent, NULL); lv_obj_align(bar, NULL, LV_ALIGN_IN_TOP_MID, 0, +10); lv_bar_set_value(bar, 30); /* % */ label = lv_label_create(bar, NULL); lv_label_set_text(label, "30%"); lv_label_set_style(label, &lv_style_pretty); lv_obj_...
void lv_example_flex_1(void) { /*创建具有 ROW flex 方向的容器*/ lv_obj_t * cont_row = lv_obj_create(lv_screen_active()); lv_obj_set_size(cont_row, 300, 75); lv_obj_align(cont_row, LV_ALIGN_TOP_MID, 0, 5); lv_obj_set_flex_flow(cont_row, LV_FLEX_FLOW_ROW); ...