码迷,mamicode.com
首页 > 其他好文 > 详细

支付宝 咻一咻 纯 代码

时间:2016-04-12 00:23:00      阅读:198      评论:0      收藏:0      [点我收藏+]

标签:

//

//  ViewController.m

//  Wjk-day2-咻一咻2016年

//

//  Created by 王建科 on 16/4/11.

//  Copyright © 2016年 第一小组. All rights reserved.

//

 

#import "ViewController.h"

 

@interface ViewController ()

@property(nonatomic,weak) UIView* pictureView;

@end

 

@implementation ViewController

 

- (void)viewDidLoad {

    [super viewDidLoad];

    // Do any additional setup after loading the view, typically from a nib.

    self.view.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0];

    [self addPutUp];

}

 

- (void)didReceiveMemoryWarning {

    [super didReceiveMemoryWarning];

    // Dispose of any resources that can be recreated.

}

 

 

- (void)addPutUp{

    UIButton * but = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, 100, 100)];

    [but setImage:[UIImage imageNamed:@"alipay_msp_op_success"] forState:UIControlStateNormal];//@"alipay_msp_op_success"  图片名

    [but setBackgroundImage:[UIImage imageNamed:@"alipay_msp_op_success"] forState:UIControlStateNormal];

    but.center = self.view.center;

    

//    69 176 249

    but.backgroundColor = [UIColor colorWithRed:69/255.0 green:176/255.0 blue:249/255.0 alpha:1];

    [self.view addSubview:but];

    

    but.layer.cornerRadius = 50;

    

    

    [but addTarget:self action:@selector(tagetbutton:) forControlEvents:UIControlEventTouchUpInside];

    

    

}

 

- (UIView*)addPutUpView{

    UIView * big = [[UIView alloc]initWithFrame:CGRectMake(0,0, 100, 100)];

    big.center = self.view.center;

    big.layer.cornerRadius = 50;

    big.backgroundColor = [UIColor colorWithRed:69/255.0 green:176/255.0 blue:249/255.0 alpha:1];

//    [big.image = [UIImage imageNamed:@"alipay_msp_op_success"] ;

//    _pictureView = big;

    

    

    

//    return big;

    

    return big;

    

    

    

 

}

 

 

-(void)tagetbutton:(UIButton*)button{

//    button.enabled=NO;

   

    for(int i = 0;i<10;i++){

        UIView * big = [self addPutUpView];

        [self.view insertSubview:big belowSubview:button];

        [ UIButton animateWithDuration:5

                                 delay:1*i

                usingSpringWithDamping:1

                 initialSpringVelocity:0.5

                               options:0

                            animations:^{

                                CGFloat multiple=8.0f;

//                                _pictureView.transform = CGAffineTransformMakeScale(multiple, multiple);

                                

//                                [self  addPutUpView].transform = CGAffineTransformMakeScale(multiple, multiple);

                                big.transform = CGAffineTransformMakeScale(multiple, multiple);

//                                big.backgroundColor = self.view.backgroundColor;

                                

                                big.alpha=0;

                            }

                            completion:^(BOOL finished) {

                                

                                [big  removeFromSuperview];

                            }];

    }

    

 

}

@end

 

支付宝 咻一咻 纯 代码

标签:

原文地址:http://www.cnblogs.com/wjkboke/p/5380712.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!