硬汉嵌入式论坛

 找回密码
 立即注册
查看: 392|回复: 4
收起左侧

[LVGL] 移植的lvgl标签部件怎么用不了,其他部件可以

[复制链接]

7

主题

15

回帖

36

积分

新手上路

积分
36
发表于 2023-7-22 08:53:47 | 显示全部楼层 |阅读模式
移植的lvgl标签部件怎么用不了,其他部件可以
回复

使用道具 举报

7

主题

15

回帖

36

积分

新手上路

积分
36
 楼主| 发表于 2023-7-22 08:54:06 | 显示全部楼层
v8.3.1版本
回复

使用道具 举报

1万

主题

6万

回帖

10万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
107220
QQ
发表于 2023-7-22 09:16:45 | 显示全部楼层
8.3.8


[C] 纯文本查看 复制代码
void lv_ex_label_1(void)
{
    lv_obj_t * label1 = lv_label_create(lv_scr_act());
    lv_label_set_long_mode(label1, LV_LABEL_LONG_WRAP);     /*Break the long lines*/
    lv_label_set_recolor(label1, true);                      /*Enable re-coloring by commands in the text*/
    //lv_label_set_align(label1, LV_LABEL_ALIGN_CENTER);       /*Center aligned lines*/
    lv_label_set_text(label1, "#0000ff Re-color# #ff00ff words# #ff0000 of a# label "
                              "and  wrap long text automatically.");
    lv_obj_set_width(label1, 150);
    lv_obj_align_to(label1, NULL, LV_ALIGN_CENTER, 0, -30);

    lv_obj_t * label2 = lv_label_create(lv_scr_act());
    lv_label_set_long_mode(label2, LV_LABEL_LONG_SCROLL_CIRCULAR);     /*Circular scroll*/
    lv_obj_set_width(label2, 150);
    lv_label_set_text(label2, "It is a circularly scrolling text. ");
    lv_obj_align_to(label2, NULL, LV_ALIGN_CENTER, 0, 30);
}


124.png
回复

使用道具 举报

7

主题

15

回帖

36

积分

新手上路

积分
36
 楼主| 发表于 2023-7-22 10:14:19 | 显示全部楼层
写到模拟器没有问题,就是写到程序里没有反应,也没报错
回复

使用道具 举报

7

主题

15

回帖

36

积分

新手上路

积分
36
 楼主| 发表于 2023-7-22 11:20:59 | 显示全部楼层
模拟器可以正常显示,写进程序里没法显示
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|Archiver|手机版|硬汉嵌入式论坛

GMT+8, 2024-5-21 23:17 , Processed in 0.166235 second(s), 29 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表