2012-03-27 12 views
6

मैंने reloadData के बजाय insertRowsAtIndexPath का उपयोग किया। पहली लोडिंग पर, एनीमेशन बहुत तेज़ है क्योंकि पंक्तियों की संख्या अधिक है।uitableview insertRowsAtIndexPath एनिमेशन की गति को नियंत्रित करें

क्या मैं insertRowsAtIndexPath की गति एनीमेशन नियंत्रित कर सकता हूं?

धन्यवाद।

उत्तर

0

मुझे लगता है कि एनीमेशन गति में हेरफेर करना संभव नहीं है।

शायद आप scrollToRowAtIndesPath का उपयोग कर सकते हैं।

-3

बिल्कुल अपरीक्षित, लेकिन आप एक पांच सेकंड एनीमेशन के लिए यह कोशिश कर सकते:

[UIView animateWithDuration:5. animations:^(void){ 
    [_tableView insertRowsAtIndexPath:... animated:NO]; 
}]; 
0

अवहेलना insertRowsAtIndexPaths और के रूप में आप देरी के साथ की तरह कस्टम एनिमेशन जोड़ें।

- (void)insertRowsAtIndexPaths:(NSArray *)indexPaths withRowAnimation: (UITableViewRowAnimation)animation 

{ 

for (NSIndexPath *indexPath in indexPaths) 
{ 
    UITableViewCell *cell = [self cellForRowAtIndexPath:indexPath]; 

    [cell setFrame:CGRectMake(320, cell.frame.origin.y, cell.frame.size.width, cell.frame.size.height)]; 

    [UIView beginAnimations:NULL context:nil]; 
    [UIView setAnimationDuration:1]; 
    [cell setFrame:CGRectMake(0, cell.frame.origin.y, cell.frame.size.width, cell.frame.size.height)]; 
    [UIView commitAnimations]; 
} 
} 
संबंधित मुद्दे