UIImageView加抖动效果(转)
2014-07-20 17:10
176 查看
CGAffineTransform moveRight = CGAffineTransformTranslate(CGAffineTransformIdentity, 20, 0);
CGAffineTransform moveLeft = CGAffineTransformTranslate(CGAffineTransformIdentity, -20, 0);
CGAffineTransform resetTransform = CGAffineTransformTranslate(CGAffineTransformIdentity, 0, 0);
[UIView animateWithDuration:0.1 animations:^{
self.transform = moveLeft;
} completion:^(BOOL finished) {
[UIView animateWithDuration:0.1 animations:^{
self.transform = moveRight;
} completion:^(BOOL finished) {
[UIView animateWithDuration:0.1 animations:^{
self.transform = moveLeft;
} completion:^(BOOL finished) {
[UIView animateWithDuration:0.1 animations:^{
self.transform = resetTransform;
}];
}];
}];
}];
rect1.origin.x -= 10;
[UIView animateWithDuration:0 delay:0 options:UIViewAnimationTransitionNone animations:^(void){
logInWindow.frame = rect1;
} completion:^(BOOL finshed){
[UIView animateWithDuration:0.01 delay:0 options:UIViewAnimationOptionAutoreverse | UIViewAnimationOptionRepeat animations:^(void){
[UIView setAnimationRepeatCount:20];
logInWindow.frame = firstRect;
} completion:^(BOOL finshed){
}]; }];
CGAffineTransform moveLeft = CGAffineTransformTranslate(CGAffineTransformIdentity, -20, 0);
CGAffineTransform resetTransform = CGAffineTransformTranslate(CGAffineTransformIdentity, 0, 0);
[UIView animateWithDuration:0.1 animations:^{
self.transform = moveLeft;
} completion:^(BOOL finished) {
[UIView animateWithDuration:0.1 animations:^{
self.transform = moveRight;
} completion:^(BOOL finished) {
[UIView animateWithDuration:0.1 animations:^{
self.transform = moveLeft;
} completion:^(BOOL finished) {
[UIView animateWithDuration:0.1 animations:^{
self.transform = resetTransform;
}];
}];
}];
}];
rect1.origin.x -= 10;
[UIView animateWithDuration:0 delay:0 options:UIViewAnimationTransitionNone animations:^(void){
logInWindow.frame = rect1;
} completion:^(BOOL finshed){
[UIView animateWithDuration:0.01 delay:0 options:UIViewAnimationOptionAutoreverse | UIViewAnimationOptionRepeat animations:^(void){
[UIView setAnimationRepeatCount:20];
logInWindow.frame = firstRect;
} completion:^(BOOL finshed){
}]; }];
相关文章推荐
- iOS 6编程-UIScrollView滚动视图结合UIImageView图像视图实现图像缩放效果
- ios UIImageView添加图片动画效果,添加了手势之后,依然没有反应的解决方法
- 【iOS开发】关于显示一连串图片组成动画效果UIImageView的使用
- 如何让UIImageView具有像UIButton一样的点击效果
- UISegmentedControl + UISlider +UIImageView的动画效果
- UIImageView和UIButton拉伸效果的实现
- UIScrollView,UIPageControl,UIImageView 实现图片轮播的效果
- iOS开发UIImage和UIImageView属性介绍,实现图片动画,实现开始/停止按钮效果
- IOS-UIButton和UIImageView中Image拉伸效果的实现
- 有趣的EditView为空时的抖动效果(用户名和密码)--第三方开源--ClearEditText
- UIButton和UIImageView中Image拉伸效果的实现
- view抖动效果,可以同时添加震动和声音
- ios UIimageView 手势移动动画效果
- 【学习ios之路:UI系列】实现轮播图效果(UIImageView,UIScrollView,UIPageControl,NSTimer相结合)
- 【iOS开发-9】UIImage和UIImageView属性介绍,实现图片动画,实现开始/停止按钮效果
- 为UIImageView图片增加阴影效果
- UIScrollView,UIPageControl,UIImageView 实现图片轮播的效果
- 利用UIImageView连续播放图片动画效果
- 156 UIImageView 和 CADisplayLink 实现 Tom 汤姆猫动画效果的区别(扩展知识:分组(黄色文件夹)和文件夹引用(蓝色文件夹)区别)
- 有趣的EditView为空时的抖动效果(用户名和密码)--第三方开源--ClearEditText