当前位置:网站首页>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);
- 运行效果
边栏推荐
- Test evaluation of software testing
- 统计php程序运行时间及设置PHP最长运行时间
- 第十七章 进程内存
- One architecture to complete all tasks - transformer architecture is unifying the AI Jianghu on its own
- docker-compose公网部署redis哨兵模式
- [information retrieval] link analysis
- Opencv3.2 and opencv2.4 installation
- vscode 常用插件汇总
- Stm32f1 and stm32subeide programming example -max7219 drives 8-bit 7-segment nixie tube (based on GPIO)
- MySQL之详解索引
猜你喜欢
Oppo find N2 product form first exposure: supplement all short boards
数据仓库面试问题准备
Incremental ternary subsequence [greedy training]
去除重复字母[贪心+单调栈(用数组+len来维持单调序列)]
Learn kernel 3: use GDB to track the kernel call chain
迅为IMX6Q开发板QT系统移植tinyplay
第十七章 进程内存
一文概览2D人体姿态估计
How to package QT and share exe
Innovation and development of independent industrial software
随机推荐
Chapter 16 string localization and message Dictionary (2)
Test process arrangement (2)
【信息检索】分类和聚类的实验
Supprimer les lettres dupliquées [avidité + pile monotone (maintenir la séquence monotone avec un tableau + Len)]
ML之shap:基于boston波士顿房价回归预测数据集利用shap值对XGBoost模型实现可解释性案例
AI与生命科学
How to operate and invest games on behalf of others at sea
Excel快速合并多行数据
Data center concept
Oppo find N2 product form first exposure: supplement all short boards
What is the difference between Bi financial analysis in a narrow sense and financial analysis in a broad sense?
C # WPF realizes the real-time screen capture function of screen capture box
sql优化之查询优化器
Remove duplicate letters [greedy + monotonic stack (maintain monotonic sequence with array +len)]
leetcode:6110. 网格图中递增路径的数目【dfs + cache】
2022游戏出海实用发行策略
失败率高达80%,企业数字化转型路上有哪些挑战?
Opencv3.2 and opencv2.4 installation
卷积神经网络经典论文集合(深度学习分类篇)
No servers available for service: xxxx