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: 808

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:

  1. Create a new navigation-based project.
  2. Open RootViewController.xib and set the table view style to "Grouped".
  3. Add this responder to the RootViewController:

    - (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor blackColor];
    }
  4. Select Simulator SDK 3.2, build and run.
  5. You will get a black background (device and simulator).
  6. Select your target in the project tree.
  7. Click on Project : Upgrade Current Target for iPad.
  8. Build and run.
  9. You will get a light gray background.
  10. Revert the table view style to Plain and you will get a black background.

Thanks for your help!

© Stack Overflow or respective owner

Related posts about ipad

Related posts about uitableview