设为首页 加入收藏

TOP

【代码笔记】iOS-伸缩式动画
2017-10-13 10:28:38 】 浏览:7868
Tags:代码 笔记 iOS- 伸缩 动画

一,效果图。

二,代码。

复制代码
- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.title=@"伸缩式动画";
}
//点击任何处,弹出动画
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    
    UIView *zanView = [[UIView alloc] initWithFrame:CGRectMake(50, 100, 100, 100)];
    zanView.backgroundColor = [UIColor redColor];
    [self.view addSubview:zanView];
    
    [UIView animateWithDuration:0.3 animations:^{
        zanView.transform = CGAffineTransformMakeScale(1.2, 1.2);
    } completion:^(BOOL finished) {
        [UIView animateWithDuration:0.3 animations:^{
            zanView.transform = CGAffineTransformMakeScale(0.9, 0.9);
        } completion:^(BOOL finished) {
            [UIView animateWithDuration:0.3 animations:^{
                zanView.transform = CGAffineTransformMakeScale(1.0, 1.0);
            } completion:^(BOOL finished) {
                
            }];
        }];
    }];
    
}
复制代码

 

 

 
 
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇OC泛型 下一篇关于开发者证书失效的问题

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目