Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix uiimageview in uitableviewcell is resize when scroll table? [closed]

Tags:

ios

iphone

My code is

    [cell.imageView setImageWithURL:[NSURL URLWithString:[medium fullThumbnailURL]] placeholderImage:[UIImage imageNamed:@"missing"]];
    [cell.imageView setContentMode:UIViewContentModeScaleAspectFit];

Begin

But when scroll down and back to top again.

After scroll

How to fix this. Please help.

[Edit]

I crate table cell like this

Cell

like image 417
phuwanart Avatar asked Nov 18 '25 02:11

phuwanart


1 Answers

I've been having the same problem and I finally figured it out! UITableViewCells have their own imageView property which they seem to style in an inaccesible manner. My solution was to use a different instance name for my own UIImageView so that any instances of UITableViewCell wouldn't style it themselves.

like image 171
cagey Avatar answered Nov 20 '25 16:11

cagey



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!