//animateWithDuration 後面是多少秒 UIView *singleMapView = [[UIView alloc] initWithFrame:CGRectMake(10, 150, 300, 250)]; singleMapView.backgroundColor = [UIColor blackColor]; [self.view addSubview:singleMapView]; singleMapView.transform = CGAffineTransformMakeScale(0.05, 0.05); [UIView animateWithDuration:0.5 animations:^{ singleMapView.transform = CGAffineTransformMakeScale(1.2, 1.2); }completion:^(BOOL finish){ }];
CGAffineTransformMakeScale 縮放函數,括號內爲比例。+ (void)animateWithDuration:(NSTimeInterval)duration animations:(void (^)(void))animations completion:(void (^)(BOOLfinished))completion view由一個大小縮放到另一個大小的動畫效果。函數