lv.FLEX_FLOW.ROW_WRAP将子对象排成一排,不超过父容器的宽,否则换行 lv.FLEX_FLOW.COLUMN_WRAP将子对象放成一列,不超过父容器的高,否则换行 lv.FLEX_FLOW.ROW_REVERSE将子对象排成一行而不换行,但顺序相反 lv.FLEX_FLOW.COLUMN_REVERSE将子对象放在一列中,不换行,但顺序相反 lv.FLEX_FLOW.ROW_WRAP_REVERSE...
lv_obj_t * panel = lv_obj_create(lv_screen_active()); lv_obj_set_size(panel, 280, 120); lv_obj_set_scroll_snap_x(panel, LV_SCROLL_SNAP_CENTER); lv_obj_set_flex_flow(panel, LV_FLEX_FLOW_ROW); lv_obj_align(panel, LV_ALIGN_CENTER, 0, 20); uint32_t i; for(i = 0; i...
lv_obj_set_style_pad_bottom(ui_Panel1, 0, LV_PART_MAIN | LV_STATE_DEFAULT); lv_obj_set_style_pad_row(ui_Panel1, 0, LV_PART_MAIN | LV_STATE_DEFAULT); lv_obj_set_style_pad_column(ui_Panel1, 0, LV_PART_MAIN | LV_STATE_DEFAULT); lv_obj_set_style_border_color(ui_Panel1, ...
lv_obj_move_to_index(lv_obj_get_child(cont,0), child_cnt -1);// 将第一个界面的索引值改为最后一个界面 lv_obj_scroll_to_view(lv_obj_get_child(cont, mid_btn_index), LV_ANIM_OFF);// lv_obj_get_child 通过子索引获取对象的子对象 } } /* 保证界面居中显示 */ lv_obj_set_style_...
FLEX_FLOW.COLUMN) lv.screen_active().set_flex_align(lv.FLEX_ALIGN.CENTER, lv.FLEX_ALIGN.START, lv.FLEX_ALIGN.CENTER) cb = lv.checkbox(lv.screen_active()) cb.set_text("Apple") cb.add_event_cb(event_handler, lv.EVENT.ALL, None) cb = lv.checkbox(lv.screen_active()) cb.set_text...
(lv.FLEX_FLOW.COLUMN) lv.screen_active().set_flex_align(lv.FLEX_ALIGN.CENTER, lv.FLEX_ALIGN.START, lv.FLEX_ALIGN.CENTER) cb = lv.checkbox(lv.screen_active()) cb.set_text("Apple") cb.add_event_cb(event_handler, lv.EVENT.ALL,None) cb = lv.checkbox(lv.screen_active()) cb.set_...
lv_obj_t* label =lv_event_get_user_data(e);// 读取到标签对象 switch(code) { caseLV_EVENT_PRESSED:// 按下 lv_label_set_text(label,"The last button event:\nLV_EVENT_PRESSED"); break; caseLV_EVENT_CLICKED:// 按下且松开 lv_label_set_text(label,"The last button event:\nLV_EVENT...
可以给一个容器设置一个 flex-flow 属性,这样容器就可以使用 flex 布局方式: lv_obj_t* cont =lv_obj_create(lv_scr_act());lv_obj_set_flex_flow(cont, LV_FLEX_FLOW_ROW); 对于设置了 flex 布局的容器,在其中创建的元素都会在一个坐标轴上均匀排布。例如,以下使用for循环创建多个控件: ...
lv_anim_set_path_cb(&a, &lv_anim_path_overshoot); /* 设置路径(曲线) */ lv_anim_start(...
lv_obj_set_style_layout(ui_pgsens, LV_LAYOUT_FLEX, 0); lv_obj_set_style_pad_column(ui_pgsens, 10, 0); but the same feature works fine when the related line is changed as below. lv_obj_set_flex_flow(ui_pgsens, LV_FLEX_FLOW_COLUMN); ...