当前位置:网站首页>LVGL 8.2 Line wrap, recoloring and scrolling
LVGL 8.2 Line wrap, recoloring and scrolling
2022-07-04 13:07:00 【仙剑情缘】
Line wrap, recoloring and scrolling示例
static void lv_example_label_1(void)
{
lv_obj_t* label1 = lv_label_create(lv_scr_act()); // 创建Label对象
lv_label_set_long_mode(label1, LV_LABEL_LONG_WRAP); //LV_LABEL_LONG_WRAP模式
lv_label_set_recolor(label1, true); // 使能重新着色功能
lv_label_set_text(label1, "#0000ff Re-color# #ff00ff words# #ff0000 of a# label,align the lines to the center "
"and wrap long text automatically."); //Re-color重新着色为蓝色,words着色为紫色,of a着色为红色,其它的为控件的默认颜色
lv_obj_set_width(label1, 150); //设置label宽度
lv_obj_set_style_text_align(label1, LV_TEXT_ALIGN_CENTER, 0); //添加style特性LV_TEXT_ALIGN_CENTER到label对象
lv_obj_align(label1, LV_ALIGN_CENTER, 0, -40); // LV_ALIGN_CENTER方式对齐
lv_obj_t* label2 = lv_label_create(lv_scr_act()); // 创建Label对象
lv_label_set_long_mode(label2, LV_LABEL_LONG_SCROLL_CIRCULAR); //LV_LABEL_LONG_SCROLL_CIRCULAR循环滚动模式
lv_obj_set_width(label2, 150);//设置label宽度
lv_label_set_text(label2, "It is a circularly scrolling text. "); //设置Label显示内容
lv_obj_align(label2, LV_ALIGN_CENTER, 0, 40);//LV_ALIGN_CENTER方式对齐
}
运行效果

- 修改滚动Label宽度到320
lv_obj_set_width(label2, 320);
- 运行效果

边栏推荐
- C # WPF realizes the real-time screen capture function of screen capture box
- R language dplyr package summary_ If function calculates the mean and median of all numerical data columns in dataframe data, and summarizes all numerical variables based on conditions
- Chapter 17 process memory
- 卷积神经网络经典论文集合(深度学习分类篇)
- nowcoder重排链表
- 数据埋点的一些问题和想法
- Respect others' behavior
- 如何游戏出海代运营、游戏出海代投
- Innovation and development of independent industrial software
- Test evaluation of software testing
猜你喜欢
随机推荐
【算法leetcode】面试题 04.03. 特定深度节点链表(多语言实现)
失败率高达80%,企业数字化转型路上有哪些挑战?
R language ggplot2 visualization: gganimate package creates dynamic line graph animation (GIF) and uses transition_ The reveal function displays data step by step along a given dimension in the animat
Ultrasonic distance meter based on 51 single chip microcomputer
Digi XBee 3 rf: 4 protocols, 3 packages, 10 major functions
如何游戏出海代运营、游戏出海代投
Data warehouse interview question preparation
WT588F02B-8S(C006_03)单芯片语音ic方案为智能门铃设计降本增效赋能
Matters needing attention in overseas game Investment Agency
一文概览2D人体姿态估计
Leetcode T48: rotating images
NowCoder 反转链表
Some problems and ideas of data embedding point
gin集成支付宝支付
MySQL的触发器
Nowcoder rearrange linked list
利用Shap值进行异常值检测
软件测试之测试评估
AI与生命科学
[cloud native] how can I compete with this database?






![[information retrieval] link analysis](/img/dc/4956e8e21d8ce6be1db1822d19ca61.png)


