サブビューとして 3 つのボタンがあるビューがあります。ビューは 360 度回転するため、ボタンが回転するとボタンをクリックしたときに問題が発生します。ボタンのフレームが位置を変更しないため、間違ったタッチ イベントが発生します。
CABasicAnimation *fullRotation1;
CGFloat duration1 = 8.0;
float repeatCount1 = 0;
fullRotation1 = [CABasicAnimation animationWithKeyPath:@"transform.rotation"];
fullRotation1.fromValue = [NSNumber numberWithFloat:0];
fullRotation1.toValue = [NSNumber numberWithFloat:((360 * M_PI) / 180)];
fullRotation1.duration = duration1;
if (repeatCount1 == 0)
fullRotation1.repeatCount = MAXFLOAT;
else
fullRotation1.repeatCount = repeatCount1;
[imgrotatebutton.layer addAnimation:fullRotation1 forKey:@"360"];
ボタンフレームをレイヤーと一緒に移動するにはどうすればよいですか
ありがとう