views:

23

answers:

1

Hi,

I'm filling a TTTableViewController (via its "datasource" property) with items of class TTTableImageItem. The images are thumbnails downloaded from Youtube, and their original size is 120x90.

In my TTTableView, they are automatically reduced so that they fill in their cells. But when I scroll up or down the view, they get back to their original size, overflowing from the cells.

How can I avoid these pictures to get back to their original sizes when scrolling ?

My TTTableImageItems are created in viewDidLoad

Thanks in advance

A: 

Finally I found the problem by reading the sources of Klazuka's TTRemoteExamples (here) : there is a bug in three20's image cache logic.

To solve it, one must set its imageStyle by giving it a fixed size :

TTTableImageItem *item = [TTTableImageItem itemWithText:itemTitle imageURL:itemThumb];
item.imageStyle = [TTImageStyle styleWithImage:nil defaultImage:nil contentMode:UIViewContentModeScaleAspectFill
                                             size:CGSizeMake(120.f, 90.f)
                                             next:nil];

After that, all is good.

Harkonnen