UNLIMITED JAVA

WEB技術や普段の生活のブログ

Frameがアニメーション出来ない件についてー。

UIViewのFrameをアニメーションさせたいワケです。
もっと言うと、sizeをアニメーションさせたいワケです。
位置はpointでアニメーション出来るから。

CABasicAnimation *anime = [CABasicAnimation animationWithKeyPath:@"frame"];
anime.duration = 1.0;
anime.fromValue = [NSValue valueWithCGRect:CGRectMake(0,0,0,0)];
anime.toValue = [NSValue valueWithCGRect:CGRectMake(0, 0, 500,100)];
[label.layer addAnimation: anime forKey:@"hoge"];

あぼーん

CABasicAnimation *anime = [CABasicAnimation animationWithKeyPath:@"frame.size"];
anime.duration = 1.0;
anime.fromValue = [NSValue valueWithCGSize:CGSizeMake(0,0)];
anime.toValue = [NSValue valueWithCGSize:CGSizeMake(50,50)];
[label.layer addAnimation: anime forKey:@"hoge"];

あぼーん


何故か"bounds.size"だとアニメーション出来るんだよね、不思議。