UITableViewCellStyleDefault label width

Posted by Rob Bonner on Stack Overflow See other posts from Stack Overflow or by Rob Bonner
Published on 2010-04-09T23:21:13Z Indexed on 2010/04/09 23:23 UTC
Read the original article Hit count: 363

Filed under:

Hello all,

I am getting some odd behavior from stock table cells, or maybe not odd, maybe I am making some assumptions.

I create the cells as follows:

cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];

Then I assign an image to the default imageView property. My image usually comes in from a user, so it might be larger than the default size. To take care of this I:

 [cell.imageView setContentMode:UIViewContentModeScaleAspectFit];

which I expected to scale the image for me within the control, but in reality, the images are all over the map.

So, is there a proper way to constrain the image in stock cell types?

Thanks in advance!

© Stack Overflow or respective owner

Related posts about iphone