2016-04-13 6 views

答えて

0

は、次のよう行を追加/削除するようにしてください:

[_tableView beginUpdates]; 

// your add/remove func 

[_tableView endUpdates]; 

ドゥUIが遅い行動を減らすために上記のようなテーブルビューのために変更されます。

は、私は正常に動作します私のプロジェクトでテーブルビューのセルを挿入/削除をアニメーション化するには、以下のトリックを使用してい

0

...それがお役に立てば幸いです。

これを試すことができます。ハッピーコーディング!!!

// Here you can change the animation duration based on ur needs 
NSTimeInterval animationDuration = 2.0f; 

    [UIView animateWithDuration:animationDuration animations:^{ 

     // Disable the user interaction to the view if needed, otherwise user may interact with table view. 
     //view.userInteractionEnabled = NO; 

     [tableview beginUpdates]; 


     // insert object to table view data source 
     //[yourArray insertObject:@"Some object" atIndex:some indexpath]; 

     // Perform insert animation 
     //[tableview insertRowsAtIndexPaths:[NSArray arrayWithObject:someindexpath] withRowAnimation:UITableViewRowAnimationRight]; 

     [tableview endUpdates]; 

    } completion:^(BOOL finished) { 

     NSLog(@"Animation done"); 

     // Enable the user interaaction now 
     //view.userInteractionEnabled = YES; 

    }]; 
関連する問題