Evgeniy Kleban
Evgeniy Kleban

Reputation: 6940

Cell image resized after row tap

I have an odd bug, after use tap row cell's image changed. I didn't implement didSelectRowAtIndexPath method, so i guess its just table reloading forces image to redraw.

Here is code:

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

    //  Загружаем ячейку из класса, далее подгружаем текст из класса initialData.

    MyCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell" forIndexPath:indexPath];

    NewsParseer *news = [self.objectsArray objectAtIndex:indexPath.row];

    // Text
    cell.textLabel.text = news.text;

    // Image
    [cell.imageView setImageWithURL:news.urlImage];

    return cell;
}

Very simple. Here is screenshots, first - when app launched and load image. Second, when i tap a row.

enter image description here

enter image description here

Obviously i don't want image to resize after user interaction.

Upvotes: 0

Views: 64

Answers (1)

Evgeniy Kleban
Evgeniy Kleban

Reputation: 6940

For anyone that wondered whats going wrong, there is answer:

I tried to set image to default property of cell, called imageView, but in Storyboard and in my custom class i work with different image view (property that i call myImageView).

Upvotes: 1

Related Questions