/**
* CGAffineTransformMakeScale 缩放函数,括号内为比例。
+ (void)animateWithDuration:(NSTimeInterval)duration
animations:(void (^)(void))animations
completion:(void (^)(BOOL finished))completion
view由一个大小缩放到另外一个大小的动画效果。
*
*
*/
UIView *singleMapView = [[UIView alloc]
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 = [UIColor blackColor];
[self.view addSubview:singleMapView];
singleMapView.transform = CGAffineTransformMakeScale(0.05, 0.05);
[UIView animateWithDuration: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){
[UIView animateWithDuration:1
animations:^{
singleMapView.transform = CGAffineTransformMakeScale(1, 1);
}completion:^(BOOL finish){
}];
}];
}];
UIView *singleMapView = [[UIView alloc]
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 = [UIColor blackColor];
[self.view addSubview:singleMapView];
singleMapView.transform = CGAffineTransformMakeScale(0.05, 0.05);
[UIView animateWithDuration: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){
[UIView animateWithDuration:1
animations:^{
singleMapView.transform = CGAffineTransformMakeScale(1, 1);
}completion:^(BOOL finish){
}];
}];
}];