PDA

View Full Version : Pictures in IUTableView?




iLoveDeveloping
Dec 10, 2009, 05:32 PM
Hey,

Can anyone tell me how you put a small image in your Table View just left of each line of text? (Different picture for each line). Would i need to resize the images i have already or would the code do this for me?



admanimal
Dec 10, 2009, 09:45 PM
You might want to check out the imageView property of UITableViewCell.

filjedi
Dec 11, 2009, 05:22 AM
Hey,

Can anyone tell me how you put a small image in your Table View just left of each line of text? (Different picture for each line). Would i need to resize the images i have already or would the code do this for me?

As long as your targeting OS 3.0, it's quite easy. Like the previous poster said, use the imageView property of UITableViewCell. If your targeting an earlier version (like OS 2.2.1), you can just subclass UITableViewCell & layout the cell in Interface Builder to get the look you want.

In any case, it's better to resize the images to match the size of the imageView. Not sure about the exact size, but the height of a UITableViewCell is 44px. Hope this helps.