UITableView backgroundColor always gray on iPad
Posted
by rjobidon
on Stack Overflow
See other posts from Stack Overflow
or by rjobidon
Published on 2010-04-22T03:13:21Z
Indexed on
2010/04/24
2:23 UTC
Read the original article
Hit count: 811
Hi,
When I set the backgroundColor
for my UITableView it works fine on iPhone (device and simulator) but NOT on the iPad simulator. Instead I get a light gray background for any color I set including groupTableViewBackgroundColor
.
Steps to reproduce:
- Create a new navigation-based project.
- Open RootViewController.xib and set the table view style to "Grouped".
- Add this responder to the RootViewController:
- (void)viewDidLoad { [super viewDidLoad]; self.view.backgroundColor = [UIColor blackColor]; }
- Select Simulator SDK 3.2, build and run.
- You will get a black background (device and simulator).
- Select your target in the project tree.
- Click on Project : Upgrade Current Target for iPad.
- Build and run.
- You will get a light gray background.
- Revert the table view style to Plain and you will get a black background.
Thanks for your help!
© Stack Overflow or respective owner