* @example lv_label_set_text_fmt(label1, "%d user", user_num); */ void lv_label_set_text_fmt(lv_obj_t * obj, const char * fmt, ...) LV_FORMAT_ATTRIBUTE(2, 3); //函数实现 void lv_label_set_text_fmt(lv_obj_t * obj, const char * fmt, ...) { LV_ASSERT_OBJ(obj, ...
1、LV_LABEL_LONG_DOT 是直接操作文本缓冲区以添加/删除点。 2、使用lv_label_set_text 和 lv_label_set_text_fmt 会分配一个单独的缓冲区,不会出问题。 3、使用 lv_label_set_text_static 时我们传递给它的缓冲区必须是可写的。 1.3 文本着色 ...
LV_ALIGN_TOP_LEFT,0,0);lv_obj_align(cont_bottom, LV_ALIGN_BOTTOM_RIGHT,0,0);/* inner widget align */lv_obj_t* label_top =lv_label_create(cont_top);lv_label_set_text(label_top,"At Top Left");lv_obj
ginfo.p1_label = lv_label_create(par); ginfo.p2_label = lv_label_create(par); lv_label_set_text(ginfo.p1_label, "p1:0"); lv_label_set_text(ginfo.p2_label, "p2:0"); lv_obj_set_grid_cell(ginfo.p1_label, LV_GRID_ALIGN_START, 0, 1, LV_GRID_ALIGN_START, 1, 1); lv_obj...
所谓动态文本即指传入的字符串或数组在 label 对象里有一份拷贝,会使用动态内存申请,因此传入的数据可以在外部释放。 数据格式可以是以 '\0' 结尾的字符串,也可以是数组,两种接口如下: voidlv_label_set_text(lv_obj_t*label,constchar*text);voidlv_label_set_array_text(lv_obj_t*label,constchar*array,...
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//下面的部分就是用来修饰你...
lv_label_set_text(label_line4, "THIS IS T-HEAD RISC-V GUI DEMO");//保持对象的大小不变,当...
{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 ;...
{case0:lv_label_set_text(label,"こんにちは");status=1;break;case1:lv_label_set_text(label,"Hallo China");status=2;break;case2:lv_label_set_text(label,"ПриветКитай");status=3;break;case3:lv_label_set_text(label,"你好中国");status=0;break;default:break;}}}intmain...
lv_label_set_text_fmt(gui->main_label_temp, "%2d'C", (uint32_t) sensor_info[1]); } rtc_time_t get_time; if (pdTRUE == xQueueReceive(g_clock2lcd_queue, &get_time, pdMS_TO_TICKS(0))) { lv_label_set_text_fmt(gui->main_label_hour, "%02d", get_time.tm_hour); ...