iOS面试——动画
2016-10-14 08:49
337 查看
一、View的哪些属性可以做动画?
动画分类:
1.骨骼动画,图片帧(如人、动物走动)(UIImageView)
2.属性动画(如物品放入购物车进行移动)(UIView)
3.转场动画(一个到另一个场景,如翻页)(UIView)
4.层动画(CAAnimation、Layer)
可以做动画的值:
1.形状系列:frame bounds
2.位置系列:center
3.色彩系列:alpha color
4.角度系列:transform(旋转的角度)
会冲突的属性:
1.frame 和 center
2.frame 和 transform
3.frame 和 bounds
4.bounds 与 transform
二、 定义UIView动画开始函数是什么?结束函数是什么?
将要开始时调用
- (void)animationWillStart:(NSString *)animationID context:(void *)context{
NSLog(@"start:%@,%@",animationID,context);
}
结束时调用
- (void)animationDidStop:(NSString *)animationID finished:(NSNumber *)finished context:(void
*)context{
NSLog(@"stop:%@,%@",animationID,context);
}
1.准备:
[UIView
beginAnimations:@"view"
context:nil];
2.持续时间:
[UIView
setAnimationDuration:2];
3.回调函数:
[UIView
setAnimationDelegate:self];
4.动画曲线、速度:
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
(1)开始和结束慢:UIViewAnimationCurveEaseInOut
(2)开始慢:UIViewAnimationCurveEaseIn
(3)结束慢:UIViewAnimationCurveEaseOut
(4)动画曲线:UIViewAnimationCurveLinear
5.动画方式,起始位置:
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp
forView:self.view cache:YES];
(1)无:UIViewAnimationTransitionNone
(2)左:UIViewAnimationTransitionFlipFromLeft
(3)右:UIViewAnimationTransitionFlipFromRight
(4)上:UIViewAnimationTransitionCurlUp
(5)下:UIViewAnimationTransitionCurlDown
6.提交:
[UIView
commitAnimations];
动画分类:
1.骨骼动画,图片帧(如人、动物走动)(UIImageView)
2.属性动画(如物品放入购物车进行移动)(UIView)
3.转场动画(一个到另一个场景,如翻页)(UIView)
4.层动画(CAAnimation、Layer)
可以做动画的值:
1.形状系列:frame bounds
2.位置系列:center
3.色彩系列:alpha color
4.角度系列:transform(旋转的角度)
会冲突的属性:
1.frame 和 center
2.frame 和 transform
3.frame 和 bounds
4.bounds 与 transform
二、 定义UIView动画开始函数是什么?结束函数是什么?
将要开始时调用
- (void)animationWillStart:(NSString *)animationID context:(void *)context{
NSLog(@"start:%@,%@",animationID,context);
}
结束时调用
- (void)animationDidStop:(NSString *)animationID finished:(NSNumber *)finished context:(void
*)context{
NSLog(@"stop:%@,%@",animationID,context);
}
1.准备:
[UIView
beginAnimations:@"view"
context:nil];
2.持续时间:
[UIView
setAnimationDuration:2];
3.回调函数:
[UIView
setAnimationDelegate:self];
4.动画曲线、速度:
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
(1)开始和结束慢:UIViewAnimationCurveEaseInOut
(2)开始慢:UIViewAnimationCurveEaseIn
(3)结束慢:UIViewAnimationCurveEaseOut
(4)动画曲线:UIViewAnimationCurveLinear
5.动画方式,起始位置:
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp
forView:self.view cache:YES];
(1)无:UIViewAnimationTransitionNone
(2)左:UIViewAnimationTransitionFlipFromLeft
(3)右:UIViewAnimationTransitionFlipFromRight
(4)上:UIViewAnimationTransitionCurlUp
(5)下:UIViewAnimationTransitionCurlDown
6.提交:
[UIView
commitAnimations];
相关文章推荐
- IOS 面试 --- 动画 block
- [转]iOS动画篇:UIView动画大全
- iOS核心动画-2
- iOS动画进阶 - CAKeyframeAnimation实现过山车动画
- iOS 开发之动画篇 - 从 UIView 动画说起
- iOS 动画Animation - 5:UIBezier
- ios 视频编辑,添加文字、图片(CA动画)水印,合成视频
- iOS单例模式(面试必考)
- iOS面试总结(一)
- iOS物理仿真动画
- ios动画篇:核心动画
- iOS3D转场动画
- iOS面试重点问题
- iOS面试
- IOS面试宝典(二)(持续更新)-描述UIViewController的生命周期
- android 仿IOS滑动删除动画
- iOS动画进阶 - 实现炫酷的上拉刷新动效
- 一些常见iOS面试常见的问题(一)
- ios面试总结
- IOS中的动画——Core Animation