iPhone:How to set background image for tablerow cell?
<p>I want to put some background image for TableView row cell. I am using the following code:</p>

<pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
</code></pre>

<p>.....................</p>

<p>...................<br>
UIImage * backgroundImage = [UIImage imageNamed:@"cell.png"];
    UIColor *backgroundColor = [[UIColor alloc] initWithPatternImage:backgroundImage];<br>
    cell.opaque = NO;</p>

<p>cell.contentView.opaque = NO;</p>

<p>cell.backgroundColor = [UIColor clearColor];</p>

<p>cell.backgroundColor = backgroundColor;</p>

<p>//cell.contentView.backgroundColor = [UIColor clearColor];</p>

<p>//cell.contentView.backgroundColor = backgroundColor;</p>

<p>}</p>

<p>But it is not giving the background image properly. Could someone guide me what is the proper ways of setting background image for a tableview row?
Note: I'm also setting background image for my TableView as well using the below code:</p>

<pre><code>UIImage * backgroundImage = [UIImage imageNamed:@"Tablebackground.png"];
UIColor *backgroundColor = [[UIColor alloc] initWithPatternImage:backgroundImage];
self.myTableView.backgroundColor = [UIColor clearColor];
self.myTableView.alpha = 0.9;
self.myTableView.backgroundColor = backgroundColor;
</code></pre>

<p>I don't observe any problem for tableview background. Only thing here is, tableview background image is not being static, when scrolling happening, image is also scrolling.</p>

<p>But i want to know first how to set background image for Tableview row cell?</p>

<p>Thank you.</p>
