xcode ios 6.0 中不推荐使用组表视图背景颜色
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12539861/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Group table view background color is deprecated in ios 6.0
提问by Kyle Clegg
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.
我在 iOS 6 的情节提要上收到此警告。我会悬停以查看替换方法,但由于我正在查看情节提要,因此它没有显示任何内容。如何轻松设置背景颜色?似乎我应该能够从 Interface Builder 中做到这一点。
回答by Mhdali
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.
打开你的故事板,检查属性检查器中的所有视图,并将所有具有分组表视图背景颜色的视图更改为任何其他颜色,我将我的更改为白色,所有警告都消失了。
回答by SlateEntropy
In code you can set it using the following:
在代码中,您可以使用以下内容进行设置:
tableView.backgroundColor = [UIColor blueColor];
tableView.backgroundView = nil;
回答by iCode
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.
我注意到,在 iOS 模拟器中 groupTableViewBackgroundColor 没有显示在 iOS 6 中,而是在 iOS 5 中。在 iOS 6 的设备上,它仍然看起来像在 iOS 5 中。有趣的一点是,模拟器仍然在 groupTableViewBackgroundColor 中显示 groupTableViewBackgroundColor表,所以我认为除了 iOS 6 中的分组表视图之外,不允许将这种颜色用于其他视图。