0
votes

I have strange problem. In my application i have UITableView with list o comments. Cell is composed with UIImageView (background) and UITextView. For one-line comments i'm changing size (frame of UIImageView) of the background to fit the size of the text (it's called in cellForRowAtIndexPath:). It works fine for scrolling etc but when i'm changing size of the table with animation (UIView animateWithDuration:), new rows are displayed at the top and user can notice that frame of the background is also changed with animation. Any idea how to prevent animating this background image?

enter image description here

1
provide 2 images to compare that to evaluate erroriEinstein

1 Answers

0
votes

To animate insertion of row in your table view, I suggest you to use :

[myTable beginUpdates];
[myTable insertRowsAtIndexPaths:indexPathsToInsert withRowAnimation:UITableViewRowAnimationBottom];
[myTable endUpdates];

Where indexPathsToInsert is an array of NSIndexPath refering to the indexes of the rows to insert. Your data source have to be consistent before doing this update.