当前位置:网站首页>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);
- 运行效果

边栏推荐
- Respect others' behavior
- Data center concept
- AI与生命科学
- R语言使用epiDisplay包的followup.plot函数可视化多个ID(病例)监测指标的纵向随访图、使用stress.col参数指定强调线的id子集的颜色(色彩)
- Intelligence d'affaires bi analyse financière, analyse financière au sens étroit et analyse financière au sens large sont - ils différents?
- 电商系统中红包活动设计
- ViewModel 初体验
- 数据湖(十三):Spark与Iceberg整合DDL操作
- Codeforce:c. sum of substrings
- Learn kernel 3: use GDB to track the kernel call chain
猜你喜欢
![leetcode:6109. Number of people who know the secret [definition of DP]](/img/95/03e2606b249f26db052cf5075041c1.png)
leetcode:6109. Number of people who know the secret [definition of DP]

Practical puzzle solving | how to extract irregular ROI regions in opencv

Visual Studio调试方式详解

docker-compose公网部署redis哨兵模式

Count the running time of PHP program and set the maximum running time of PHP

Test process arrangement (2)

Ultrasonic distance meter based on 51 single chip microcomputer

为什么图片传输要使用base64编码

Codeforce:c. sum of substrings

实战解惑 | OpenCV中如何提取不规则ROI区域
随机推荐
Count the running time of PHP program and set the maximum running time of PHP
Leetcode T48: rotating images
为什么图片传输要使用base64编码
leetcode:6109. Number of people who know the secret [definition of DP]
LifeCycle
[MySQL from introduction to proficiency] [advanced chapter] (V) SQL statement execution process of MySQL
NowCoder 反转链表
Compile oglpg-9th-edition source code with clion
Stm32f1 and stm32subeide programming example -max7219 drives 8-bit 7-segment nixie tube (based on GPIO)
(1)性能调优的标准和做好调优的正确姿势-有性能问题,上HeapDump性能社区!
数据湖(十三):Spark与Iceberg整合DDL操作
架构方面的进步
R语言dplyr包summarise_if函数计算dataframe数据中所有数值数据列的均值和中位数、基于条件进行数据汇总分析(Summarize all Numeric Variables)
Test process arrangement (3)
Digi重启XBee-Pro S2C生产,有些差别需要注意
ML之shap:基于boston波士顿房价回归预测数据集利用shap值对XGBoost模型实现可解释性案例
ML:SHAP值的简介、原理、使用方法、经典案例之详细攻略
Nowcoder reverse linked list
ViewModel 初体验
Leetcode 61: rotating linked list