UIImageView inside tableview changing frame position while scrolling

I'm doing a instagram like have a table view whose cells contains an UIImageView. When it appears the first time the image views are positioned correctly, but after scrolling to next cells the image view's frame Y origin is moved from 0 to 15 pixels. I already tried to force the frame to the correct position without success. here's my cellForRowAtIndexPath: code.

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{


    MITableViewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:kMITableViewCellID];
    MIPhoto *photo = [self.fetchedResultController objectAtIndexPath:indexPath];

    if (!photo.imageData) {
        if (self.tableView.dragging == NO && self.tableView.decelerating == NO) {
            [self startDownloadImage:photo forIndexPath:indexPath];
        }
        cell.imageView.image = [UIImage imageNamed:@"ImageViewBackGround.png"];
    } else {

        cell.imageView.image = [UIImage imageWithData:photo.imageData];
    }

    return cell;
}

And here are the screeshots with correct and incorrect cell layouts

Correct layout screen: https://www.dropbox.com/s/t3r7w2wp6k8kot4/Photo%2008-12-13%2022%2046%2055.png

wrong layout screen: https://www.dropbox.com/s/na7cb4a8shwc6mf/Photo%2008-12-13%2022%2047%2008.png

Answers


Solved the issue setting the cell's contentView frame programmatically to desired values.

EDIT: I tried to figure out why the cell's content view was having it's frame changed, and I found what appears to be a bug at layoutSubViews method because the bug happens when this method is called by my custom UITableViewCell subclass.


Need Your Help

SQL select rows where field contains word from another table's fields

mysql sql select contains

Using MySQL, I have a table with a name field. I want to check that name field against a set of "keywords" that indicate that the name is not a person, but a business.

Safely Handling Concurrent Memcache Updates in AppEngine

java google-app-engine caching google-cloud-datastore

The Google Apps Engine doc about safely Handling Concurrent Memcache Updates: