I have been trying to set the background color of my table view but am facing an issue
This is what I am trying to do.
//Set background color of table view (translucent)
self.tableView.backgroundColor = [UIColor colorWithRed:0.0 green:0.2 blue:0.5 alpha:0.7];
//Set frame for tableview
[self.tableView setFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height-self.picker.frame.size.height)];
After setting the table cells, I saw that there is an inconsistency in the alpha level around the table view cell (see screenshot below)
Is there anyway to make the color / alpha level consistent for the background? (Note: I am not setting a background image, only color and alpha level)
Thanks!
Zhen Hoe
backgroundColor =[UIColor colorWithRed:178/255.
you can just change the backgroundView's backgroundColor property like so: cell. selectedBackgroundView?. backgroundColor = <your color .
For changing the background color of the table view cell, you should change the contentView. backgroundColor property of the cell. Now run the project to see the effect.
I recently ran into this problem myself and think I found the solution
self.tableView.backgroundColor = [UIColor clearColor];
self.parentViewController.view.backgroundColor = [UIColor colorWithRed:0.0 green:0.2 blue:0.5 alpha:0.7];
Give that a shot, might need some massaging for your specific case (looks like you have some picture behind that translucent blue too).
You need to make the background of the UITableView clear as well as set Opaque to FALSE
[self.tableView setBackgroundColor: [UIColor clearColor]];
[self.tableView setOpaque: NO];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With