voidlv_obj_set_style_text_align(lv_obj_t* obj,lv_text_align_tvalue,lv_style_selector_tselector); 将文本垂直对齐。第三个参数selector是设置样式用的,这里可以暂时不用理会。 以下动图展示了三种长模式:显示省略号、换行并居中对齐,以及循环滚动: 需要注意的是,除了滚动以外的其它模式如果没有明确高度,...
/*Create style with the new font*/ static lv_style_t style; lv_style_init(&style); lv_style_set_text_font(&style, &font); lv_font_t * font = lv_tiny_ttf_create_data(ubuntu_font, ubuntu_font_size, 30); lv_style_set_text_font(&style, font); lv_style_set_text_align(&style...
label2.set_style_text_font(myfont_en, 0) # set the font label2.set_text("Hello LVGL!") label2.align(lv.ALIGN.CENTER, 0, 25) myfont_jp = lv.font_load("S:%s/font/font-PHT-jp-20.bin" % script_path) myfont_jp= lv.binfont_create("S:%s/font/font-PHT-jp-20.bin" % script...
lv_obj_set_size(label1,100,50);//设置宽和高 lv_label_set_text(label1,"Hello CSDN");//设置文本内容 lv_label_set_style(label1,LV_LABEL_STYLE_MAIN,&lv_style_plain_color);//设置具有背景色 lv_label_set_body_draw(label1,true);//设置绘制背景 lv_label_set_align(label1,LV_LABEL_ALIG...
LV_LABEL_ALIGN_RIGHT,//文本右对齐 }; typedefuint8_tlv_label_align_t; 2.1.3 标签样式数据类型 enum{ LV_LABEL_STYLE_MAIN, }; typedefuint8_tlv_label_style_t; 2.2 API 接口 2.2.1 创建标签 lv_obj_t*lv_label_create(lv_obj_t* par,constlv_obj_t* copy); ...
2.1.259 Part 1 Section 17.7.8.2, pPr (Style Paragraph Properties) 2.1.260 Part 1 Section 17.7.9.1, rPr (Run Properties) 2.1.261 Part 1 Section 17.8, Fonts 2.1.262 Part 1 Section 17.8.3.1, altName (Alternate Names for Font) 2.1.263 Part 1 Section 17.8.3.2, charset (...
static void lv_textarea_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj); 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); ...
2.1.265 Part 4 Section 2.8.2.2, charset (Character Set Supported By Font) 2.1.266 Part 4 Section 2.8.2.3, embedBold (Bold Style Font Style Embedding) 2.1.267 Part 4 Section 2.8.2.4, embedBoldItalic (Bold Italic Font Style Embedding) 2.1.268 Part 4 Section 2.8.2.5, embedIta...
lv_label_set_text(cz_label, "温度: 18℃ 湿度: 65%\n #ff5151 晴##99cc33 到##2894ff 多云#"); lv_obj_set_style_text_font(cz_label, &lv_font_stliti_24, 0); lv_obj_set_width(cz_label, 310); lv_obj_align(cz_label, LV_ALIGN_LEFT_MID, 5, 0); ...
lv_kb_set_style(kb, LV_KB_STYLE_BTN_PR, &pr_style); /*Create a text area. The keyboard will write here*/ lv_obj_t *ta = lv_ta_create(lv_scr_act(), NULL); lv_obj_align(ta, NULL, LV_ALIGN_IN_TOP_MID, 0, 10);