UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
view.backgroundColor = [UIColor redColor];
[self.view addSubview:view];
CABasicAnimation *animation=[CABasicAnimation animationWithKeyPath:@"transform.scale"];
animation.fromValue=[NSNumber numberWithFloat:0.5];
animation.toValue=[NSNumber numberWithFloat:1.0];
animation.duration=1.0;
animation.autoreverses=NO;
animation.repeatCount=0;
animation.removedOnCompletion=NO;
animation.fillMode=kCAFillModeForwards;
[view.layer addAnimation:animation forKey:@"zoom"];
iOS CABasicAnimation 縮放動畫
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.