弹簧动画效果
来源:互联网 发布:淘宝美工是做什么的 编辑:程序博客网 时间:2024/06/11 17:45
github:https://github.com/potato512/SYAnimation
使用CASpringAnimation实现弹簧动画效果。
效果图:
代码示例:
- (void)springAnimation{ UIView *view = [[UIView alloc] initWithFrame:CGRectMake(120.0, 10.0, (self.view.frame.size.width - 10.0 - 120.0), 100.0)]; [self.view addSubview:view]; view.backgroundColor = [UIColor colorWithWhite:0.5 alpha:0.2]; UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(10.0, 10.0, 50.0, 30.0)]; label.backgroundColor = [UIColor redColor]; [view addSubview:label]; CASpringAnimation *spring = [CASpringAnimation animationWithKeyPath:@"position.x"]; spring.damping = 5; spring.stiffness = 100; spring.mass = 1; spring.initialVelocity = 0; spring.fromValue = @(label.layer.position.x); spring.toValue = @(label.layer.position.x + 50.0); spring.autoreverses = YES; spring.repeatCount = MAXFLOAT; spring.duration = spring.settlingDuration; [label.layer addAnimation:spring forKey:spring.keyPath];}
0 0
- Android 弹簧动画效果
- 弹簧动画效果
- Android 弹簧动画效果
- 果冻弹簧效果动画
- 弹簧动画效果
- iOS动画实现:弹簧效果
- iOS动画实现:弹簧效果
- iOS动画之弹簧效果
- 类似弹簧跳动的动画效果
- 弹簧动画
- 仿IOS效果-带弹簧动画的ListView
- 【Android】实现一个弹簧(Spring)效果的动画
- 知识片段---弹簧动画
- ios弹簧动画实现
- ios弹簧动画
- Android SpringAnimation 弹簧动画
- 弹簧动画-----Spring Animation
- Android弹簧动画
- Android通用可自定义下拉刷新上拉加载组件PopularRefreshLayout
- mybatis 打印sql执行语句
- 1Vue + Jwt + SpringBoot + Ldap 完成登录认证
- spring top做自定义注解
- Android boot.img的由来
- 弹簧动画效果
- 算法导论第15章15.2-6
- mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication错误解决办法
- 动态规划问题整理
- Linux下的一些控制台快捷键
- 声波
- 【java】jsp简介
- jQuery
- yuv格式较好分析