Reputation:
i have one tableview
with style grouped. in this i set background color clearcolor
like this , cell.backgroundColor =[UIColor blackColor];
now i want this cell transparent. may be i can do this with opacity. but in this how can i set opacity.
i want same like this for cell background >>
here opacity . how can i do same this by coding in cell background ?
Upvotes: 3
Views: 10672
Reputation: 747
//. Add this to viewdidload()
tableView.backgroundColor = UIColor.black
tableView.alpha = 0.65
Upvotes: 0
Reputation: 1311
Apart from the above answer. You can achieve transparency by simply setting cell's contentView alpha.
cell.backgroundColor = .black
cell.contentView.alpha = 0.5
Upvotes: 0
Reputation: 3390
You can use cell.alpha = 0;
then your cell is invisible but all textLabels etc. to.
If you want only the cell.backgroundColor a bit transparent you can use
cell.backgroundColor = [UIColor colorWithRed:0. green:0.39 blue:0.106 alpha:0.]
Upvotes: 6