Group table view background color is deprecated in

2019-03-11 06:50发布

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.

3条回答
霸刀☆藐视天下
2楼-- · 2019-03-11 07:03

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

查看更多
乱世女痞
3楼-- · 2019-03-11 07:09

In code you can set it using the following:

tableView.backgroundColor = [UIColor blueColor];
tableView.backgroundView = nil;
查看更多
疯言疯语
4楼-- · 2019-03-11 07:18

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.

查看更多
登录 后发表回答