views:

383

answers:

2

In UITableViewCellStyleDefault, setting the contentMode on the imageView has no result. If I change my build SDK to version 3.1, everything again works.

I don't get any warnings or errors when compiling on 3.0 but this code:

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

seems to default to the UIViewContentModeCenter, so all of my pictures exceed the cell boundaries and encroach on neighboring cells.

Let me reiterate that if I change my target to 3.1 everything works correctly and all pictures are scaled accordingly to fit in the default imageView

Is this a known bug?

A: 

I don't know if it's known, but the same thing happens to me.

Pyro2927
+1  A: 

I'm getting the same effect on iOS 4 SDK when using UITableViewCellStyleDefault.

For additional info see http://stackoverflow.com/questions/3182649/ios-sdk-uiviewcontentmodescaleaspectfit-vs-uiviewcontentmodescaleaspectfill

Dalmazio Brisinda
I posted this as an answer because I was unable to add a comment to the original post. Looks like I don't yet have enough reputation points to do so.
Dalmazio Brisinda
the image will not appear, when u used UITableViewCellStyleDefault, u have to use UITableViewCellStyleSubtitle..
Imam Arief W