Frage

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.

War es hilfreich?

Lösung

You can set selectedBackgroundView on your cell.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top