こんにちは、私は1つのアプリケーションを開発しています.1つのビューのアニメーションを左から右、右から左に移動し、そのビューに含まれるラベルの値を変更しました.しかし、左または右のボタンをクリックするとそのビューが削除され、新しいビューは古いビューを上書きしています。だから私は上書きしたくありません。新しいビューを追加したいだけです。私のコードは
    -(void)centerAnimation1:(id)sender
     {
         UIView *currentView = daysview;
            theWindow = daysview;
         // set up an animation for the transition between the views
        CATransition *animation = [CATransition animation];
            animation.delegate = self;
        [animation setDuration:0.4];
        [animation setType:kCATransitionMoveIn];
         if(rhtolft)
         {
             [animation setSubtype:kCATransitionFromLeft];
         }
         else
         {
             [animation setSubtype:kCATransitionFromRight];
         }
        [animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
        [[theWindow layer] addAnimation:animation forKey:@"SwitchToView1"];
            [currentView removeFromSuperview];
        }
        - (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag{
             if(animate)
             {
                 CATransition *animation = [CATransition animation];
                 animation.delegate = self;
                 [animation setDuration:0.4];
                 [animation setType:kCATransitionMoveIn];
                 if(rhtolft)
                 {
                     [animation setSubtype:kCATransitionFromLeft];
                     rhtolft=NO;
                 }
                 else
                 {
                     [animation setSubtype:kCATransitionFromRight];                
                 }
                 [[theWindow layer] addAnimation:animation forKey:@"SwitchToView1"];
                 animate=NO;
                 [self.view addSubview:daysview];
             }
         }
左ボタンと右ボタンのアクション メソッドで centerAnimation1 メソッドを呼び出すだけです。これを呼び出した後、ラベルの値を変更しました。