创建标签:lv_obj_t * label = lv_label_create(parent); 1.1 设置显示文本 创建了标签部件之后我们就可以设置文本来显示。 直接设置要显示的文本:lv_label_set_text(label, "New text"); 格式化给定要显示的文本:lv_label_set_text_fmt(label, “%s: %d”, “Value”, 15); ...
lv_obj_t * label = lv_label_create(lv_scr_act()); lv_label_set_text(label, "Hello ...
lv_style_init()样式对象初始化 lv_style_set_text_opa()设置样式 lv_label_create()创建文本 lv_label_set_text()设置文本值 lv_obj_add_style()设置定义的样式 lv_btn_create()创建按钮 lv_obj_set_pos()设置位置坐标 /** * @file lv_demo_test.c * *//*** * INCLUDES ***/#include"lv_dem...
LV_FONT_DECLARE(myFont);//声明中文字库lv_obj_t * label =lv_label_create(ui_Screen1); lv_label_set_text(label,"脑子好痒,好像要长脑子惹");//lv_obj_set_size(label,250,100);lv_obj_set_pos(label,-100,100); lv_obj_set_style_text_font(label,&myFont,0); lv_obj_center(label); ...
lv_label_set_text(label_speed_set,buf);} } } 复制代码 必须保证程序是UTF-8编码 2.外部字体...
localxiaoguoLabel=lvgl.label_create(itemCont,nil) lvgl.obj_set_style_local_text_font(xiaoguoLabel, lvgl.LABEL_PART_MAIN, lvgl.STATE_DEFAULT, font68) lvgl.label_set_text(xiaoguoLabel,"测试@TEST")lvgl.obj_align(xiaoguoLabel,modeLabelCont, lvgl.ALIGN_OUT_RIGHT_MID,238,0)...
(SETTINGS_TXT); lv_obj_t * MUSIC = lv_btn_create(contanier2); lv_obj_add_event_cb(MUSIC, MUSIC_event_handler, LV_EVENT_CLICKED, NULL); lv_obj_set_pos(MUSIC,125,20); lv_obj_set_size(MUSIC, 80, 80); lv_obj_t * MUSIC_TXT = lv_label_create(MUSIC); lv_label_set_text_fmt...
{case 0:lv_label_set_text(label,"こんにちは");status = 1 ;break ;case 1:lv_label_set_text(label,"Hallo China");status = 2 ;break ;case 2:lv_label_set_text(label,"ПриветКитай");status = 3 ;break ;case 3:lv_label_set_text(label,"你好中国");status = 0 ;...
lv_obj_t*label=lv_label_create(lv_scr_act());lv_label_set_text(label,"REAL");lv_obj_center(label); 如果此时运行显示效果如下 二、创建style并设置你想要的效果 代码类型如下 staticlv_style_tfont_style;//定义LV_STYLElv_style_init(&font_style);//初始化LV_STYLE//下面的部分就是用来修饰你...
label_create(btn1, nil) lvgl.label_set_text(label, "Button") local btn2 = lvgl.btn_create(lvgl.scr_act(), nil) lvgl.obj_set_event_cb(btn2, event_handler) lvgl.obj_align(btn2, nil, lvgl.ALIGN_CENTER, 0, 40) lvgl.btn_set_checkable(btn2, true) lvgl.btn_toggle(btn2) lvgl....