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

边栏推荐
- Data warehouse interview question preparation
- Oppo find N2 product form first exposure: supplement all short boards
- GCC [6] - 4 stages of compilation
- 实战解惑 | OpenCV中如何提取不规则ROI区域
- SqlServer函数,存储过程的创建和使用
- MySQL的存储过程练习题
- Learn kernel 3: use GDB to track the kernel call chain
- 关于miui12.5 红米k20pro用au或者povo2出现问题的解决办法
- Solutions to the problems of miui12.5 red rice k20pro using Au or povo2
- 去除重复字母[贪心+单调栈(用数组+len来维持单调序列)]
猜你喜欢

Innovation and development of independent industrial software

Compile oglpg-9th-edition source code with clion

实时数据仓库

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

统计php程序运行时间及设置PHP最长运行时间

Query optimizer for SQL optimization

Learn kernel 3: use GDB to track the kernel call chain

Pandora IOT development board learning (RT thread) - Experiment 3 button experiment (learning notes)

按照功能对Boost库进行分类

失败率高达80%,企业数字化转型路上有哪些挑战?
随机推荐
尊重他人的行为
gin集成支付宝支付
2022游戏出海实用发行策略
【信息检索】分类和聚类的实验
PyTorch的自动求导机制详细解析,PyTorch的核心魔法
sql优化之查询优化器
Redis daily notes
一文概览2D人体姿态估计
Some problems and ideas of data embedding point
opencv3.2 和opencv2.4安装
scratch古堡历险记 电子学会图形化编程scratch等级考试三级真题和答案解析2022年6月
Leetcode T48:旋转图像
C # WPF realizes the real-time screen capture function of screen capture box
关于miui12.5 红米k20pro用au或者povo2出现问题的解决办法
(1)性能调优的标准和做好调优的正确姿势-有性能问题,上HeapDump性能社区!
leetcode:6109. 知道秘密的人数【dp的定义】
Innovation and development of independent industrial software
卷积神经网络经典论文集合(深度学习分类篇)
MATLAB中tiledlayout函数使用
ViewModel 初体验