UITableView Alpha Issues

I have a UIView with a UITableView for subview. UIView has an image applied to its background via setBackGroundColor, and I applied the background to the UITableView in the same way. Both images are PNGs, and the background for the UITableView has transparency levels in it that don't seem to work - it seems that PNG is displayed without considering the transparency data inside it - I should see the background from the UIView through it. The main code that I use for applying background images is:

UIImage *patternImage = [UIImage imageNamed:@"background.png"];
[tableContainer setBackgroundColor:[UIColor colorWithPatternImage: patternImage]];

I'm at a dead end. Any ideas?

+3
source share
2 answers

You need to make sure your table view is not opaque.

Builder "" . , ,

tableView.opaque = NO;

, . , , , , , . , .

+3

, backgroundColor cellView, backgroundColor .

!

+1

Source: https://habr.com/ru/post/1702204/


All Articles