当前位置:网站首页>LVLG 8.2 circular scrolling animation of a label
LVLG 8.2 circular scrolling animation of a label
2022-07-04 13:07:00 【仙剑情缘】
创建自定义circular scrolling文本滚动效果
static void lv_example_label_5(void)
{
static lv_anim_t animation_template; /动画变量定义
static lv_style_t label_style;
lv_anim_init(&animation_template);
lv_anim_set_delay(&animation_template, 1000); //设置等待1秒开始动画
lv_anim_set_repeat_delay(&animation_template,
3000); // 动画回到初时位置后延时3秒重复滚动
/*Initialize the label style with the animation template*/
lv_style_init(&label_style);
lv_style_set_anim(&label_style, &animation_template); // sytle关联动画变量
lv_obj_t* label1 = lv_label_create(lv_scr_act()); //创建label
lv_label_set_long_mode(label1, LV_LABEL_LONG_SCROLL_CIRCULAR); //Circular scroll模式
lv_obj_set_width(label1, 150); // 设置宽度
lv_label_set_text(label1, "It is a circularly scrolling text. ");//设置文本内容
lv_obj_align(label1, LV_ALIGN_CENTER, 0, 40);//LV_ALIGN_CENTER方式对齐
lv_obj_add_style(label1, &label_style, LV_STATE_DEFAULT); //label添加style
}
运行效果
边栏推荐
- Digi XBee 3 RF: 4个协议,3种封装,10个大功能
- STM32F1与STM32CubeIDE编程实例-MAX7219驱动8位7段数码管(基于GPIO)
- Excel quickly merges multiple rows of data
- [MySQL from introduction to proficiency] [advanced chapter] (IV) MySQL permission management and control
- Some problems and ideas of data embedding point
- 数据湖(十三):Spark与Iceberg整合DDL操作
- 递增的三元子序列[贪心训练]
- vscode 常用插件汇总
- R language uses dplyr package group_ The by function and the summarize function calculate the mean and standard deviation of the target variables based on the grouped variables
- Learn kernel 3: use GDB to track the kernel call chain
猜你喜欢
sql优化之explain
Vscode common plug-ins summary
Data center concept
潘多拉 IOT 开发板学习(RT-Thread)—— 实验3 按键实验(学习笔记)
codeforce:C. Sum of Substrings【边界处理 + 贡献思维 + 灵光一现】
第十七章 进程内存
flink sql-client.sh 使用教程
统计php程序运行时间及设置PHP最长运行时间
Transplant tinyplay for imx6q development board QT system
Excel quickly merges multiple rows of data
随机推荐
How to operate and invest games on behalf of others at sea
Nowcoder rearrange linked list
Learn kernel 3: use GDB to track the kernel call chain
MATLAB中tiledlayout函数使用
LVGL 8.2 List
数据埋点的一些问题和想法
[MySQL from introduction to proficiency] [advanced chapter] (IV) MySQL permission management and control
实战解惑 | OpenCV中如何提取不规则ROI区域
迅为IMX6Q开发板QT系统移植tinyplay
关于miui12.5 红米k20pro用au或者povo2出现问题的解决办法
SqlServer函数,存储过程的创建和使用
Gin integrated Alipay payment
按照功能对Boost库进行分类
LVGL 8.2 Line
聊聊保证线程安全的 10 个小技巧
gin集成支付宝支付
【MySQL从入门到精通】【高级篇】(五)MySQL的SQL语句执行流程
Redis daily notes
Digi restarts XBee Pro S2C production. Some differences need to be noted
卷积神经网络经典论文集合(深度学习分类篇)