当前位置:网站首页>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
- 数据中台概念
- An overview of 2D human posture estimation
- (1)性能调优的标准和做好调优的正确姿势-有性能问题,上HeapDump性能社区!
- Oppo find N2 product form first exposure: supplement all short boards
- Solutions to the problems of miui12.5 red rice k20pro using Au or povo2
- Popular framework: the use of glide
- NowCoder 反转链表
- [algorithm leetcode] interview question 04.03 Specific depth node linked list (Multilingual Implementation)
- 迅为IMX6Q开发板QT系统移植tinyplay
猜你喜欢
Test process arrangement (2)
去除重复字母[贪心+单调栈(用数组+len来维持单调序列)]
How to package QT and share exe
SqlServer函数,存储过程的创建和使用
NowCoder 反转链表
LVGL 8.2 Line
C # WPF realizes the real-time screen capture function of screen capture box
Oppo find N2 product form first exposure: supplement all short boards
sql优化之explain
Detailed explanation of visual studio debugging methods
随机推荐
一文概览2D人体姿态估计
Leetcode T48:旋转图像
去除重複字母[貪心+單調棧(用數組+len來維持單調序列)]
电商系统中红包活动设计
架构方面的进步
Xcode 异常图片导致ipa包增大问题
如何游戏出海代运营、游戏出海代投
92.(cesium篇)cesium楼栋分层
DDD application and practice of domestic hotel transactions -- Code
The game goes to sea and operates globally
Map of mL: Based on Boston house price regression prediction data set, an interpretable case of xgboost model using map value
ViewModel 初体验
基于51单片机的超声波测距仪
ML之shap:基于boston波士顿房价回归预测数据集利用shap值对XGBoost模型实现可解释性案例
Test process arrangement (2)
Detailed index of MySQL
Learn kernel 3: use GDB to track the kernel call chain
统计php程序运行时间及设置PHP最长运行时间
Leetcode 61: rotating linked list
尊重他人的行为