Göktuğ Aral Göktuğ Aral - 2 years ago 104
Objective-C Question

UITableView backgroundColor always white on iPad

I'm working on a project. I have plenty of

s which are set as clear color. Their views' background color are set to my custom color and everything is fine on iPhone.

The issue comes up on iPad! I tried almost everything, but my
has a white color.

I checked the other topics, like: UITableView backgroundColor always gray on iPad, but nothing worked. Also, my problem is not grey, it's white as snow!

What might be the reason of it?

Answer Source

Instead of setting the background color, trying using a background view instead, like this:

- (void)viewDidLoad {
    self.tableView.backgroundView = [UIView new];
    self.tableView.backgroundView.backgroundColor = [UIColor clearColor];

I've had problems where using the backgroundColor doesn't always have an effect, but setting a background view instead works fine.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download