Выполните следующие действия при нажатии кнопки:
// For Button 1
- (IBAction)pressedButton1:(id)sender{
// Create an animation lasting 1 second
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1.00];
[UIView setAnimationDelegate:self];
// Set your arrow image view's center x property to that of the button
myArrowImageView.center = CGPointMake(myButton1.center.x, myArrowImageView.center.y);
[UIView commitAnimations];
}
// For Button 2
- (IBAction)pressedButton2:(id)sender{
// Create an animation lasting 1 second
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1.00];
[UIView setAnimationDelegate:self];
// Set your arrow image view's center x property to that of the 2nd button
myArrowImageView.center = CGPointMake(myButton2.center.x, myArrowImageView.center.y);
[UIView commitAnimations];
}
// For Button 3
- (IBAction)pressedButton3:(id)sender{
// Create an animation lasting 1 second
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1.00];
[UIView setAnimationDelegate:self];
// Set your arrow image view's center x property to that of the 3rd button
myArrowImageView.center = CGPointMake(myButton3.center.x, myArrowImageView.center.y);
[UIView commitAnimations];
}
PS Всегда полезно также публиковать исходный код, когда вы задаете вопрос.Это помогает людям дать вам лучший ответ.