Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is groupTableViewBackgroundColor deprecated on iOS 6?

I was just testing my app with iOS 6.0 and Xcode 4.5GM and I have set up a view like this:

[self.view setBackgroundColor:[UIColor groupTableViewBackgroundColor]]; 

So, the view has the same pattern than a common table view.

This works fine on iOS 4 and 5, but in iOS 6 it just gives me a white background.

Is this deprecated? If so, how can I replace it?

Thanks

like image 812
estemendoza Avatar asked Sep 17 '12 03:09

estemendoza


2 Answers

This method will be deprecated during the 6.0 seed program If you want to have a background in your own view that looks like the table view background, then you should create an empty table view and place it behind your content.

like image 107
dhcdht Avatar answered Oct 22 '22 09:10

dhcdht


First, add this to your viewDidLoad:

self.tableView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"tableViewBackground.png"]]; 

OR

self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"tableViewBackground.png"]]; 

Then add this images to your app:

tableViewBackground.png

tableViewBackground.png

[email protected]

tableViewBackground@2x.png

like image 26
3lvis Avatar answered Oct 22 '22 07:10

3lvis