lv_obj_scroll_to(obj, x, y, anim_en);lv_obj_scroll_by(obj, x, y, anim_en);lv_obj_scroll_to_view(child, anim_en); 注意前两个函数的区别:前者是滚动到相应的位置,多次调用只有第一次实际有效;后者是模拟滚动的操作,实际滚动方向是相反的,并且多次调用效果可以叠加。除此之外,后者甚至可以滚动...
lv_obj_scroll_to_view(lv_obj_get_child(cont, mid_btn_index), LV_ANIM_OFF);// lv_obj_get_child 通过子索引获取对象的子对象 } } /* 保证界面居中显示 */ lv_obj_set_style_translate_y(lv_obj_get_child(cont, mid_btn_index),0,0); break; } } } } 五、完整代码 #ifdefLV_LVGL_H_...
lv_obj_t * sw = lv_switch_create(lv_screen_active()); lv_obj_align(sw, LV_ALIGN_TOP_RIGHT, -20, 10); lv_obj_add_event_cb(sw, sw_event_cb, LV_EVENT_ALL, panel); lv_obj_t * label = lv_label_create(lv_screen_active()); lv_label_set_text(label, "One scroll"); lv_o...
As in the title, when lv_obj_set_flex_flow(pg, LV_FLEX_FLOW_ROW) is active, with the lv_obj_scroll_to_view function, the page scrolls in one direction at first. When it comes to the first object after the last object, scrolling does not occur. lv_obj_t *ui_pgsens = 0; // ...
Embedded graphics library to create beautiful UIs for any MCU, MPU and display type. - lvgl/src/core/lv_obj_scroll.c at release/v8.3 · lvgl/lvgl
lv_style_set_x(&style, lv_pct(20)); lv_style_set_y(&style, lv_pct(40)); /*Create an object with the new style*/ lv_obj_t * obj = lv_obj_create(lv_scr_act()); lv_obj_add_style(obj, &style, 0); lv_obj_t * label = lv_label_create(obj); ...
static void cursor_blink_anim_cb(void * obj, int32_t show); static void pwd_char_hider_anim(void * obj, int32_t x); static void pwd_char_hider_anim_ready(lv_anim_t * a); static void pwd_char_hider(lv_obj_t * obj); ...
lv_obj_set_scrollbar_mode(ui->Main_canvas_cam, LV_SCROLLBAR_MODE_OFF); ⚠️ 需要注意由于lvgl canvas对象和dcmi使用同一块缓冲区,canvas对象大小和dcmi缓冲区大小必须匹配,相应的也必须和OV5640输出尺寸匹配 4.刷新lvgl canvas对象 DCMI摄像头垂直同步中断服务例程即如下回调函数 ...
LCD_Fill(area->x1, area->y1, area->x2, area->y2, color_p); lv_disp_flush_ready( disp ); } LCD_Fill函数,这种方式为区域填充,也可以多次调用点填充(速度慢,不推荐) /*** *函数名:LCD_Fill *输 入:xsta:x起始 * ysta:y起始 * xend:x结束 * yend:y结束 * color:颜色的指针,指向...
我们可以通过lv_obj_set_xxx和lv_obj_get_xxxAPI来设置或者获取这些属性。 2.1. 控件大小 只改变宽度: /** * Set the width of an object * @param obj pointer to an object * @param w the new width