首页 > 其他 > 详细

一个动画效果

时间:2015-03-13 10:28:49      阅读:282      评论:0      收藏:0      [点我收藏+]

一个动画效果

by 伍雪颖


#define SCREEN_WIDTH ([UIScreen mainScreen].bounds.size.width)
@interface ViewController ()
@end
@implementation ViewController

- (
void)viewDidLoad {
    [
super viewDidLoad];
   
UIView *view = [[UIView alloc] initWithFrame:CGRectMake(100, 100, 100, 100)];
    view.
backgroundColor = [UIColor redColor];
    [
self.view addSubview:view];
   
    view.
transform = CGAffineTransformMakeTranslation(SCREEN_WIDTH, 0);
    [
UIView animateWithDuration:0.5 delay:0 usingSpringWithDamping:0.7 initialSpringVelocity:0 options:0 animations:^{
        view.
transform = CGAffineTransformIdentity;
    }
completion:NULL];
}

一个动画效果

原文:http://www.cnblogs.com/gcczhongduan/p/4334321.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!