zoukankan      html  css  js  c++  java
  • iOS pop动画之弹性动画的基本使用

    - (void)viewDidLoad

    {

        [super viewDidLoad];

        [self initButton];

    }

    - (void)initButton

    {

        UIButton *button = [[UIButton alloc]init];

        button.backgroundColor = [UIColor purpleColor];

        button.bounds = CGRectMake(0, 0, 100, 50);

        button.center = self.view.center;

        button.layer.cornerRadius = 5.f;

        [button addTarget:self action:@selector(clickedBtn:) forControlEvents:UIControlEventTouchUpInside];

        [self.view addSubview:button];

        self.button = button;

    }

    - (void)clickedBtn:(UIButton *)button

    {

        POPSpringAnimation *spring = [POPSpringAnimation animationWithPropertyNamed:kPOPLayerScaleXY];

        spring.velocity = [NSValue valueWithCGSize:CGSizeMake(10.f, 10.f)];

        spring.toValue = [NSValue valueWithCGSize:CGSizeMake(1.f, 1.f)];

        spring.springBounciness = 18.f;

        [self.button.layer pop_addAnimation:spring forKey:nil];

    }

  • 相关阅读:
    update语句中存在''语法书写方式
    CSS的代码风格
    CSS的语法规范
    CSS层叠样式表导读
    CSS简介
    HTML基本标签(下)
    HTML基本标签(上)
    HTML简介导读
    集合及其运用
    字典的镶嵌
  • 原文地址:https://www.cnblogs.com/oumygade/p/4462198.html
Copyright © 2011-2022 走看看