문제

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.

도움이 되었습니까?

해결책

You can set selectedBackgroundView on your cell.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top