LVGL 8.2 Line wrap, recoloring and scrolling
and line LVGL 8.2 wrap
2023-09-14 09:06:41 时间
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);
- 运行效果
相关文章
- disk boot failure ,insert sysytem disk and press enter解决方法
- SP Module 1 - Phonetics and Representations of Speech
- MIT_6.s081_Lab4:Xv6 and Trap
- ORA-22295: cannot bind more than 4000 bytes data to LOB and LONG columns in 1 statement ORACLE 报错 故障修复 远程处理
- ORA-24080: unschedule_propagation pending for QUEUE string and DESTINATION string ORACLE 报错 故障修复 远程处理
- ORA-46006: Cannot mix VPD column and Fusion column security policies ORACLE 报错 故障修复 远程处理
- ORA-00071: process number must be between 1 and string ORACLE 报错 故障修复 远程处理
- MySQL中的OR与AND操作符比较(mysqlor和and)
- DSN and Oracle: The Power of a Winning Combination(dsnoracle)
- 多条件查询MySQL中使用And多条件查询的步骤(mysql中and)
- 深入浅出:MySQL中AND和OR运算符使用方法(mysql中and和or)
- Redis and Perl: The Perfect Pair for HighPerformance Data Processing(redisperl)
- Exploring the Origins and Significance of the MySQL Name(mysql名字)
- Boost Your Efficiency and Performance with Linux CPU St Optimizations(linuxcpust)
- Get Ahead with GE Linux: Boost Your Efficiency and Productivity(gelinux)
- Mysql中强大的AND运算符的使用方法探究(mysql中and的使用)
- MySQL中如何正确使用AND运算符(mysql中and怎么用)
- MySQL中的AND和OR使用逻辑运算符优化查询语句(mysql中and与or)