Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UITableView image on the left hand side [duplicate]

Possible Duplicate:
adding images to UItableView

I want to add image in UITableView in the left hand side how could I add it?

like image 609
Arpit B Parekh Avatar asked Aug 18 '11 04:08

Arpit B Parekh


2 Answers

In the cellForRowAtIndexPath method add:

cell.imageView.image = [UIImage imageNamed:@"img.png"];

and thats it! really easy!

If you are using custom cells then you need to add an ImageView to your custom cell in IB. Then create, connect and synthesize an IBOutlet for it and add this code to the cellForRowAtIndexPath method:

cell.yourImageOutlet.image = [UIImage imageNamed:@"img.png"];
like image 52
JonasG Avatar answered Sep 28 '22 02:09

JonasG


Just add image in cellForRowAtIndexPath method..

 cell.imageView.image = yourImage;
like image 22
Hadi Avatar answered Sep 28 '22 04:09

Hadi