iOS块动画使用
来源:互联网 发布:股票量化软件 编辑:程序博客网 时间:2024/06/01 20:31
-块动画
+(void)animateWithDuration:(NSTimeInterval)duration
animations:(void (^)(void))animations
completion:(void (^__nullable)(BOOL finished))completion;+(void)animateWithDuration:(NSTimeInterval)duration
animations:(void (^)(void))animations;+(void)animateWithDuration:(NSTimeInterval)duration
delay:(NSTimeInterval)delay
usingSpringWithDamping:(CGFloat)dampingRatio
initialSpringVelocity:(CGFloat)velocity
options:(UIViewAnimationOptions)options
animations:(void (^)(void))animations
completion:(void (^__nullable)(BOOL finished))completion;- duration : 动画时间
- delay : 延迟时间
- dampingRatio : 阻尼系数(弹性) 越小越弹
- velocity : 速率
- options : 选项
- animations : 做动画的代码块
- completion : 动画完成的代码块 “回调”
// 做动画按钮点击事件- (IBAction)makeAnim:(id)sender { // 1. // [UIView animateWithDuration:.2 animations:^{ // self.orgView.frame = CGRectMake(0, 0, 200, 200); // self.orgView.backgroundColor = [UIColor blueColor]; // }]; // 2. // [UIView animateWithDuration:3 animations:^{ // self.orgView.frame = CGRectMake(0, 0, 200, 200); // self.orgView.backgroundColor = [UIColor blueColor]; // } completion:^(BOOL finished) { // NSLog(@"动画完成"); // }]; // 3. /** duration : 时间 delay : 延迟 damping : 阻尼效果 velocity : 速度 options : 选项 animations : "需要做动画的代码" completion : "动画完成后执行的代码 回调" */ [UIView animateWithDuration:.25 delay:0 usingSpringWithDamping:.8 initialSpringVelocity:.7 options:0 animations:^{ self.orgView.frame = CGRectMake(100, 100, 200, 200); self.orgView.backgroundColor = [UIColor blueColor]; } completion:^(BOOL finished) { NSLog(@"动画完成"); }];}
0 0
- iOS块动画使用
- iOS----四方块 动画按钮实现
- iOS开发 - UIView动画扩展块(UIViewAnimationWithBlocks)
- IOS开发,块代码使用
- iOS之块的使用
- ios 块的使用(block)
- IOS中的动画使用
- iOS使用帧动画
- IOS 开发学习笔记-基础 UI(十)九宫格布局,块动画,字典转模型,Xib使用
- 【iOS代码块】项目中常用的动画效果
- iOS中图像、动画、滑块、步进控件(201546)
- iOS开发 -- imageView (动画) UISlider进度条(滑块)
- ios 动画的基本使用
- IOS基础动画使用1
- iOS中动画的使用
- iOS 基础动画的使用
- iOS- 动画UIView animateWithDuration 使用
- iOS动画的简单使用
- Spring整理系列(03)——spring容器ApplicationContext初始化(spring应用上下文初始化)
- HDU 1171 Big Event in HDU(DP)
- HDU 5794 A Simple Chess(多校,dp,容斥)
- 不同系统如何安装 Git
- 2016-8-6夏令营总结(kmp,回文串,扩展kmp)
- iOS块动画使用
- characters
- okhttp3使用
- “除非Microsoft FTP 服务(FTPSVC)正在运行,否则无法启动FTP站点。服务目前已停止”问题解决
- iOS头尾式动画使用
- nrf24l01+
- CodeForces 703B Mishka and trip【水题】
- Gym 100531 D Digits 【暴力】
- Fedora 设置全局 Kindle 护眼色