在创建完成并设置完文本之后加一句 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); 注意前两个函数的区别:前者是滚动到相应...
static void scroll_x_anim(void * obj, int32_t v); static void scroll_y_anim(void * obj, int32_t v); static void scroll_anim_ready_cb(lv_anim_t * a); static void scroll_area_into_view(const lv_area_t * area, lv_obj_t * child, lv_point_t * scroll_value, ...
lv_obj_scroll_to_y(obj, 0, LV_ANIM_OFF); calc_auto_size(obj, NULL, &h); }/*Calculate the sizes in percentage*/ bool pct_h = LV_COORD_IS_PCT(h) ? true : false; lv_coord_t parent_h = lv_obj_get_content_height(parent); ...
static void lv_textarea_event(const lv_obj_class_t * class_p, lv_event_t * e); 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); ...
ext->anim_speed = LV_LABEL_SCROLL_SPEED; ext->offset.x =0; ext->offset.y =0; lv_obj_set_design_func(new_label, lv_label_design); lv_obj_set_signal_func(new_label, lv_label_signal);/*Init the new label*/if(copy ==NULL) { ...
2.1.1888 Part 4 Section 19.4.2.62, UIObj (UI Object Toggle) 2.1.1889 Part 4 Section 19.4.2.63, Val (Scroll bar position) 2.1.1890 Part 4 Section 19.4.2.64, ValidIds (Valid ID) 2.1.1891 Part 4 Section 19.4.2.68, WidthMin (Minimum Width) 2.1.1892 Part 4 Section 19.5....
2.1.1888 Part 4 Section 19.4.2.62, UIObj (UI Object Toggle) 2.1.1889 Part 4 Section 19.4.2.63, Val (Scroll bar position) 2.1.1890 Part 4 Section 19.4.2.64, ValidIds (Valid ID) 2.1.1891 Part 4 Section 19.4.2.68, WidthMin (Minimum Width) 2.1.1892 Part 4 Section 19.5...
#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*/ ...
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....