Question

I set a background image to cell of uitableView using the following code in cellForRowAtIndexPath function:

 UIImageView *av = [[UIImageView alloc] initWithFrame:CGRectMake(20, 20, 277, 58)];
   av.backgroundColor = [UIColor clearColor];
   av.opaque = NO;
   av.image = [UIImage imageNamed:@"pattern_gray0.png"];
   cell.backgroundView = av;

I want when user presses the row change the color of row to green color and keep the background image at the same line.

How can I do this? Thanks in advance.

Was it helpful?

Solution

You can set selectedBackgroundView on your cell.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top