启动页动画

来源:互联网 发布:哪个淘宝网的东西是正品 编辑:程序博客网 时间:2024/05/14 20:07

/**

 *    CGAffineTransformMakeScale 缩放函数,括号内为比例。

 + (void)animateWithDuration:(NSTimeInterval)duration 

 animations:(void (^)(void))animations 

 completion:(void (^)(BOOL finished))completion

      view由一个大小缩放到另外一个大小的动画效果。

 *

 *

 */

UIView *singleMapView = [[UIViewalloc]

                             initWithFrame:CGRectMake(self.view.frame.size.width/4,self.view.frame.size.height/4 ,self.view.frame.size.width/2,self.view.frame.size.height/2)];

    singleMapView.backgroundColor = [UIColorblackColor];

    [self.viewaddSubview:singleMapView];

    singleMapView.transform = CGAffineTransformMakeScale(0.05, 0.05);

    [UIViewanimateWithDuration:1

                     animations:^{

                         singleMapView.transform =CGAffineTransformMakeScale(1.2,1.2);

                     }completion:^(BOOL finish){

                         [UIView animateWithDuration:1

                                          animations:^{

                                              singleMapView.transform =CGAffineTransformMakeScale(0.9,0.9);

                                          }completion:^(BOOL finish){

                                              [UIViewanimateWithDuration:1

                                                               animations:^{

                                                                   singleMapView.transform =CGAffineTransformMakeScale(1,1);

                                                               }completion:^(BOOL finish){

                                                                   

                                                               }];

                                          }];

                     }];

 UIView *singleMapView = [[UIViewalloc]

                             initWithFrame:CGRectMake(self.view.frame.size.width/4,self.view.frame.size.height/4 ,self.view.frame.size.width/2,self.view.frame.size.height/2)];

    singleMapView.backgroundColor = [UIColorblackColor];

    [self.viewaddSubview:singleMapView];

    singleMapView.transform = CGAffineTransformMakeScale(0.05, 0.05);

    [UIViewanimateWithDuration:1

                     animations:^{

                         singleMapView.transform =CGAffineTransformMakeScale(1.2,1.2);

                     }completion:^(BOOL finish){

                         [UIView animateWithDuration:1

                                          animations:^{

                                              singleMapView.transform =CGAffineTransformMakeScale(0.9,0.9);

                                          }completion:^(BOOL finish){

                                              [UIViewanimateWithDuration:1

                                                               animations:^{

                                                                   singleMapView.transform =CGAffineTransformMakeScale(1,1);

                                                               }completion:^(BOOL finish){

                                                                   

                                                               }];

                                          }];

                     }];



0 0