1

親データリストから特定の行を選択すると、サーバーから子UITableViewsノードデータを取得し、それらを同じUITableview. ディクショナリを使用して親ノードに戻るように準備しましたが、すべて正常に機能しています。親データ リストを子データ リストに移動するときに、ナビゲーション スタイルのアニメーションが必要です。誰かがこれを行う方法を教えてください。

ビューを反転する次のコードUIViewAnimationOptionTransitionFlipFromLeftUIViewAnimationOptionTransitionFlipFromRightアニメーションを使用してみました-同様のものを探していますが、反転はありません-別のUITableViewをプッシュしているふりをしたいような単純なナビゲーションスタイルのアニメーション。

[UIView transitionWithView: self.listTableView
                   duration: 0.35f
                   options: UIViewAnimationOptionTransitionFlipFromLeft
                   animations: ^(void) {
                        [self.listTableView reloadData];
                    } completion: ^(BOOL isFinished){
                    }];
4

1 に答える 1

2

これがコード付きロジックです。

QuartzCore framework in以下のコードを使用するには、.h`をインポートする必要があります。AS #インポート

// Method to replace a given subview with another using a specified transition type, direction, and duration
-(void)replaceSubview:(UIView *)oldView withSubview:(UIView *)newView transition:(NSString *)transition direction:(NSString *)direction duration:(NSTimeInterval)duration
     {
  // Set up the animation
  CATransition *animation = [CATransition animation];
  // Set the type and if appropriate direction of the transition, 
  if (transition == kCATransitionFade)
       {
        [animation setType:kCATransitionFade];
   } 
  else
     {
  [animation setType:transition];
  [animation setSubtype:direction];
 }
// Set the duration and timing function of the transtion -- duration is passed in as a parameter, use ease in/ease out as the timing function
 [animation setDuration:duration];
 [animation setTimingFunction:[CAMediaTimingFunction   functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
 [[oldView layer] addAnimation:animation forKey:@"transitionViewAnimation"];    
   }  

以下のように、TableView の行がクリックされたときに、Above メソッドを呼び出します。

     [self replaceSubview:thisTableView 
                 withSubview:thisTableView 
                  transition:kCATransitionPush
                   direction:kCATransitionFromLeft
                    duration:0.3];


 //thisTableView is instance of UItableView.
于 2012-11-12T11:48:32.080 に答える