objective c – iOS Solid text over a background image and low alpha cell background


How do I get the text in my cells to show as solid text while still fading the cell background so I can see the image behind?

I have the following in my ViewController:
`

- (void)viewDidLoad {
    // Used to see the background image
    self.tableView.backgroundColor = [UIColor clearColor];
    self.tableView.backgroundView = [[UIImageView alloc] initWithImage:[UIImage    imageNamed:@"background.png"]];
    self.tableView.backgroundView.contentMode = UIViewContentModeScaleAspectFill;
}

-(void) tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *) cell forRowAtIndexPath:(NSIndexPath *)indexPath { 
    cell.alpha=0.5; 
    cell.textLabel.alpha=1.0; 
}

The result is shown in the image where the background image can be seen through the text and cell background. I only want to see the image through the cell background and have the text solid.

Is there a way to set the text to have an alpha of 1.0 while the background is 0.5?

app screenshot

Latest articles

spot_imgspot_img

Related articles

Leave a reply

Please enter your comment!
Please enter your name here

spot_imgspot_img