在创建完成并设置完文本之后加一句 lv_obj_scroll_to_y(obj,0, LV_ANIM_OFF); 就可以了 原因:官方控件里面设置文本的接口里面设置文本后会设置一次光标位置到文本末尾,这样会导致文本滚动到最后
lv_obj_set_scroll_dir(obj, LV_DIR_RIGHT); 那么就只能向右滚动到底,不能向左折回。 还可以通过以下几个函数利用代码执行滚动: 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); 注意前两个函数的区别:前者是滚动到相应...
voidmy_gui(void){lv_obj_t*parent = lv_obj_create(lv_scr_act());/* 创建父对象,默认大小 */lv_obj_set_size(parent,400,240);/* 设置父对象的大小 */lv_obj_t* child = lv_obj_create(parent);/* 在先前创建的父对象上创建一个子对象 */lv_obj_set_pos(child,50,10);/* 设置子对象的...
lv_obj_get_height(obj); } else { h = lv_objgetstyle_height(, LV_PART_MAIN); h_content = h == LV_SIZE_CONTENT? true : false; /* sure the object isnot scrolled when it has autosize*/ (h_content) { lv_obj_scroll_to_y(obj, 0, LV_ANIMOFF); calc_auto_size(...
While scrollbar mode and scroll directions are implemented, scroll snap is not configurable from EEZ Studio. Like scroll direction, two dropdowns could be added to select between lv_scroll_snap_t variants for each axis: A workaround is to manually call lv_obj_set_scroll_snap_x(obj, LV_...
i); lv_textarea_add_char(obj, _lv_txt_unicode_to_encoded(c)); } return; } lv_res_t res= insert_handler(obj, txt; if(res != LV_RES_OK) return; /*If the text is empty, invalidate it to hide the placeholder*/ ...
2.1.1791 Part 4 Section 6.4.2.62, UIObj (UI Object Toggle) 2.1.1792 Part 4 Section 6.4.2.63, Val (Scroll bar position) 2.1.1793 Part 4 Section 6.4.2.64, ValidIds (Valid ID) 2.1.1794 Part 4 Section 6.4.2.68, WidthMin (Minimum Width) 2.1.1795 Part 4 Section 6.4.3....
#define LV_USE_ASSERT_OBJ 0 /*Check the object's type and existence (e.g. not deleted). (Slow)*/ /*Add a custom handler when assert happens e.g. to restart the MCU*/ #define LV_ASSERT_HANDLER_INCLUDE <stdint.h> #define LV_ASSERT_HANDLER while(1); /*Halt by default*/ ...
1,x=e.daSrc||"",v=e.clickFn||function(){};if(t&&i){var h=navigator.userAgent,y=/MicroMessenger/gi.test(h),b=n.isAndroid()&&y;if(b){var k=g(i);$(t).append(k),f[d]=k,k&&k[0]&&(k[0].addEventListener("click",function(){x&&s.addStat(x),m(d),v&&v()}),w...
1,x=e.daSrc||"",v=e.clickFn||function(){};if(t&&i){var h=navigator.userAgent,y=/MicroMessenger/gi.test(h),b=n.isAndroid()&&y;if(b){var k=g(i);$(t).append(k),f[d]=k,k&&k[0]&&(k[0].addEventListener("click",function(){x&&s.addStat(x),m(d),v&&v()}),w&&(...