UITableViewCell imageView.contentMode does not work in version 3.0

In UITableViewCellStyleDefault setting the contentMode in the image has no effect. If I change the build SDK to version 3.1, everything will work again.

I do not get any warnings or errors when compiling to 3.0, but this code:

 cell.imageView.contentMode = UIViewContentModeScaleAspectFit; cell.imageView.image = [UIImage imageNamed:[[NSString stringWithFormat:@"%@head.jpg",[gametype objectAtIndex:indexPath.row]]lowercaseString]]; 

seems like the default for a UIViewContentModeCenter, so all of my images exceed cell borders and encroach on neighboring cells.

Let me reiterate that if I change my target to 3.1, everything will work correctly, and all pictures will be scaled accordingly to match the default imageView

Is this a known bug?

+4
source share
1 answer

I get the same effect from the iOS 4 SDK when using the UITableViewCellStyleDefault.

See the iOS SDK UIViewContentModeScaleAspectFit and UIViewContentModeScaleAspectFill for more information

+1
source

Source: https://habr.com/ru/post/1303180/


All Articles