16

Possible Duplicate:
is groupTableViewBackgroundColor deprecated on iOS 6?

I am getting this warning on my storyboard in iOS 6. I would hover to see the replacement method, but since I'm viewing the storyboard it shows me nothing. How can I easily set the background color? Seems like I should be able to do this from the Interface Builder.

Community
  • 1
  • 1
Kyle Clegg
  • 38,547
  • 26
  • 130
  • 141
  • 2
    I'm getting this warning too, but I'm confused as to what I should be using instead of it, and I can't seem to find any mention of it in the apple release notes. – joshaidan Sep 22 '12 at 03:38
  • @joshaidan see mhdali's answer below. you have to change the background color to something other than "group table view bg color." also -- a decent workaround is to add a new uiview, send it to back, and color it whatever color you want. – Kyle Clegg Sep 28 '12 at 06:19
  • 2
    I know I can fix it by changing the colour, but I wish I had an explanation from Apple as to why the colour was removed, and what they recommend doing instead. – joshaidan Sep 28 '12 at 14:14

3 Answers3

23

Open your storyboard, check all views in the Attributes Inspector and change all views with Grouped Table View background color to any other color, I changed mine to white and all warnings went away.

attributes inspector

Kyle Clegg
  • 38,547
  • 26
  • 130
  • 141
Mhdali
  • 690
  • 7
  • 17
15

In code you can set it using the following:

tableView.backgroundColor = [UIColor blueColor];
tableView.backgroundView = nil;
SlateEntropy
  • 3,988
  • 1
  • 23
  • 31
  • 1
    I found your answer after doing a lot of tests on my own and for me the first two lines work fine, no need to use the third one. – rtovars Sep 23 '12 at 02:33
  • Yes, now I remember. The last line was for changing the colour to transparent. Updated answer. – SlateEntropy Sep 23 '12 at 11:43
2

I've noticed, that in iOS simulator the groupTableViewBackgroundColor is not shown in iOS 6 but in iOS 5. On a device with iOS 6 it still looks like in iOS 5. An interesting point is, that the simulator still shows the groupTableViewBackgroundColor in grouped tables, so I think it is just not allowed to use this color for other views than grouped table views in iOS 6.

iCode
  • 320
  • 2
  • 13
  • And that's lucky because I would have had to make an urgent update to fix this, had this background colour really stopped working on iOS6 devices like it has in the simulator. I guess a lot of other apps would also have been affected. – Clafou Sep 24 '12 at 10:53
  • Thanks for this answer. All solutions I found on the web state that you need to use another color. I actually want to keep using the table view background color, but cannot find anywhere how to do that. If it still works on the device, then I don't need to change anything now. – fishinear Oct 04 '12 at 16:20