如果需要调整控件的尺寸,可以使用函数,lv_obj_set_width()和lv_obj_set_height()分别调整长宽,或使用lv_obj_set_size()一并调整: lv_obj_t* cont =lv_obj_create(lv_scr_act());lv_obj_t* label =lv_label_create(cont);lv_label_set_text(label,"Helllllo, world!");lv_obj_set_size(cont,16...
lv_style_int_tptop =lv_obj_get_style_pad_top(obj, LV_OBJ_PART_MAIN); lv_style_int_tpbottom =lv_obj_get_style_pad_bottom(obj, LV_OBJ_PART_MAIN); lv_obj_set_width(obj, h - ptop - pbottom); lv_obj_set_height(obj, h - ptop - pbottom); ...
The functionslv_obj_set_content_widthandlv_obj_set_content_heightsubtract the border width from the object width but they don't check which border sides are hidden. As a result, when only the top border is active, the border width will erroneously be subtracted twice. ...
默认情况标签的大小会自动拓展成和文本一样的大小(LV_SIZE_CONTENT),也可以设置宽高:lv_obj_set_size lv_obj_set_width lv_obj_set_height 这样就可能出现文本的宽度或高度大小与label不一样的情况,需要做一些调整,下面是几种模式: highlighter- less LV_LABEL_LONG_WRAP如果有多个换行,并且如果高度为LV_SIZE_...
Will be expanded to: void <name> (lv_obj_t * obj, lv_event_t e) Examples: static LV_EVENT_CB_DECLARE(my_event1); //Protoype declaration static LV_EVENT_CB_DECLARE(my_event1) { if(e == LV_EVENT_CLICKED) { lv_obj_set_hidden(obj ,true); } } ...
359 void lv_obj_set_y(lv_obj_t * obj, lv_coord_t y); 360 367 void lv_obj_set_size(lv_obj_t * obj, lv_coord_t w, lv_coord_t h); 368 374 void lv_obj_set_width(lv_obj_t * obj, lv_coord_t w); 375 381 void lv_obj_set_height(lv_obj_t * obj, lv_coord...
lv_group_focus_obj(); Set the focus, the control has no response, which is successful in some interfaces0 Kudos Reply All forum topics Previous Topic Next Topic 6 Replies 09-18-2024 02:10 AM 263 Views Veronika_techsupport NXP TechSupport Hello @qqt_996 ...
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...
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) { lv_obj_set_click(new_label, false); lv_label_set_long_mode(new_label, LV_LABEL_LONG_EXPAND); lv_label_set_text(new_label, "...
对于V7,Style的使用方式多是直接调用Style设计函数针对某一个控件进行样式(风格)的绑定,例如设置控件背景透明度lv_obj_set_style_local_bg_opa,确实这类命名方式很方便对控件做样式设计,逐个绑定就是了,并且只要是控件都是obj类型的没有区别,当然也有一些问题,那就是当控件数量多的时候,还设置这么多样式就增加了很...