ram
ram

Reputation: 83

how to add UIImage view inside table cells for iphone

i want to add a UIimabeView inside table view cells to disyplay images (5 images on tap) no is it pissible to show Images in table cells??/

Upvotes: 0

Views: 586

Answers (2)

Swapnil Luktuke
Swapnil Luktuke

Reputation: 10475

Yes it is possible. You can add it to the cell's contentView in TableView's cellForRowAtIndexPath method.

Alternatively, you can create a custom tableview cell if you want to avoid the hassle of adjusting the imageView's positions in the code and you can just set the images for these image view in the cellForRowAtIndexPath method.

Upvotes: 1

Mike Weller
Mike Weller

Reputation: 45598

If you want to add views to a cell, add them to the contentView of the cell:

UIImageView *myImageView = ...;
[cell.contentView addSubview:myImageView];

Upvotes: 0

Related Questions