3 つのボタンがある単純なアプリケーションを作成しようとしています。ユーザーがいずれかのボタンをクリックすると、新しい位置にアニメーション化 (移動) されます! これはすべて、次のコードから機能します。
[UIView animateWithDuration:1.2
delay:0.1
options: UIViewAnimationCurveEaseOut
animations:^
{
//Moving the Sum (UIButton which will move through this animation)
CGRect frame = Sum.frame;
frame.origin.y = -20;
frame.origin.x = (-120);
Sum.frame = frame;
.....
....
}
completion:^(BOOL finished)
{
NSLog(@"Completed");
//adding subview after the animation is complete! newView is an example!
[self.view addSubview:newView];}];
問題は、サブビューをメイン ビューに追加すると、すべてのボタンが元の位置に戻ることです。つまり、それらは永久に移動されませんでした..どうすればこれを解決できますか? みんな助けてください!