CABasicAnimation
の回転をアニメートするために を使用しNSView
ます。コードは iPhone で問題なく動作するので、今度はココアに植えたいと思います。
[self.secondView setWantsLayer:YES];
CABasicAnimation *anim2 = [CABasicAnimation animationWithKeyPath:@"transform.rotation"];
anim2.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear];
anim2.fromValue = [NSNumber numberWithFloat:0];
anim2.toValue = [NSNumber numberWithFloat:-((360*M_PI)/180)];
anim2.repeatCount = HUGE_VALF;
anim2.duration = 8.0;
[self.secondView.layer addAnimation:anim2 forKey:@"transform"];
実行すると、以下のようにビューのフレームが覆われているように見えます。
4 つの頂点が表示されていないことがわかります。
私はココアにあまり詳しくないので、どこに問題があるのか誰か教えてもらえますか?
ありがとう!