LV_ALIGN_CENTER, LV_ALIGN_OUT_TOP_LEFT, LV_ALIGN_OUT_TOP_MID, LV_ALIGN_OUT_TOP_RIGHT, LV_ALIGN_OUT_BOTTOM_LEFT, LV_ALIGN_OUT_BOTTOM_MID, LV_ALIGN_OUT_BOTTOM_RIGHT, LV_ALIGN_OUT_LEFT_TOP, LV_ALIGN_OUT_LEFT_MID, LV_ALIGN_OUT_LEFT_BOTTOM, LV_ALIGN_OUT_RIGHT_TOP, LV_ALIGN_OUT_...
voidlv_obj_set_pos(struct_lv_obj_t*obj,lv_coord_tx,lv_coord_ty); voidlv_obj_set_size(struct_lv_obj_t*obj,lv_coord_tw,lv_coord_th); lv_coord_tlv_obj_get_width(conststruct_lv_obj_t*obj); //lv_obj_styles.h voidlv_obj_add_style(struct_lv_obj_t*obj,lv_style_t*style,lv_...
*/voidlv_obj_align_to(lv_obj_t*obj,constlv_obj_t*base,lv_align_talign,int32_tx_ofs,int32_ty_ofs); 其中,对其方式的可选值如下: enum_lv_align_t{LV_ALIGN_OUT_TOP_LEFT,// 在外顶部左边对齐LV_ALIGN_OUT_TOP_MID,// 在外顶部中间对齐LV_ALIGN_OUT_TOP_RIGHT,// 在外顶部右边对...
如果使用lv_obj_align_to函數,還可以在常量前加上LV_ALIGN_OUT_前綴,表示在參考物件的外部對齊。(圖1) LV_ALIGN_OUT_TOP_LEFT/MID/RIGHT: 分別在參考物件的上方左側、中間和右側對齊 LV_ALIGN_OUT_BOTTOM_LEFT/MID/RIGHT: 分別在參考物件的下方左側、中間和右側對齊 LV_ALIGN_OUT_LEFT/RIGHT_MID: 分別在參...
ALIGN_IN_TOP_RIGHT, 0, 20); --Copy the drop LEFT list ddlist = lvgl.dropdown_create(lvgl.scr_act(), ddlist); lvgl.obj_align(ddlist, nil, lvgl.ALIGN_IN_TOP_RIGHT, 0, 100); 仪表(gauge)# 概述# 仪表是带有刻度标签和一个或多个指针的仪表。 零件和样式# 仪表的主要部分称为lvgl....
For more examples check out the Examples folder. Hello world label C code /*Change the active screen's background color*/ lv_obj_set_style_bg_color(lv_screen_active(), lv_color_hex(0x003a57), LV_PART_MAIN); /*Create a white label, set its text and align it to the center*/ lv...
sw, LV_ALIGN_OUT_RIGHT_MID,20,0);/*Align top of the slider*/rt_kprintf("%s : power off ...
void lv_switch_01_init(void) { static rt_bool_t power_flag = RT_FALSE; lv_obj_t *sw = lv_switch_create(lv_scr_act()); lv_obj_align(sw, LV_ALIGN_TOP_LEFT, 50, 20); lv_obj_add_event_cb(sw, sw_event_cb, LV_EVENT_VALUE_CHANGED, NULL); ...
lv_obj_align(obj, LV_ALIGN_LEFT_MID, 10, 0); lv_anim_t a; lv_anim_init(&a); lv_anim_set_var(&a, obj); lv_anim_set_values(&a, 10, 100); lv_anim_set_time(&a, 1000); lv_anim_set_playback_delay(&a, 100); lv_anim_set_playback_time(&a, 300); lv_anim_set_repeat...
lv_obj_align_to(btn, dd, LV_ALIGN_OUT_TOP_MID, 0, -10); lv_obj_add_event_cb(btn, btn_event_handler, LV_EVENT_VALUE_CHANGED , dd); // 通过其他部件打开或关闭下拉列表 static void btn_event_handler(lv_event_t * e) { lv_event_code_t code = lv_event_get_code(e); ...