Keep uitableview static when inserting rows at the top

后端 未结 18 2101
名媛妹妹
名媛妹妹 2020-11-29 16:12

I have a tableView that I\'m inserting rows into at the top.

Whilst I\'m doing this I want the current view to stay completely still, so the rows only appear if you

18条回答
  •  我在风中等你
    2020-11-29 16:25

    @Dean,

    You can change your code like this to prevent animating.

    [tableView beginUpdates];
    [UIView setAnimationsEnabled:NO];
    
    // ...
    
    [tableView endUpdates];
    
    [tableView setContentOffset:newOffset animated:NO];
    [UIView setAnimationsEnabled:YES];
    

提交回复
热议问题