1

I have a View in which there are 3 buttons as subview. the view rotates 360 degree, so as the button rotates the problem is when i click the button, as the frame of a button does not changes the position so it fires the wrong touch event.

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"];

how should i attain button frame to be moved along with layer

Thanks

TasZ
  • 167
  • 11
  • can you please post the code where you adding three buttons to superview. – 2intor Feb 22 '14 at 07:36
  • buttons are added in xib – TasZ Feb 22 '14 at 13:39
  • the view is spinning with buttons on it. i want to tap on button but as animation works on layer frame of button does not gets change when animation to its superview is given – TasZ Feb 25 '14 at 06:08

0 Answers0