一个UIViewController的背景分组表视图颜色 [英] Background of a UIViewController to Grouped table view color

查看:171
本文介绍了一个UIViewController的背景分组表视图颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在一个UITableView分组风格,表视图的背景是有点像一个灰色的纹理颜色。我怎么能抓住这个值,这样我可以设置一个UIViewController的整个背景是什么颜色?

In a UITableView grouped style, the background of the table view is sort of like a grayish texture color. How can I grab that value such that I can set the entire background of a UIViewController to be that color?

推荐答案

如果您正在为iPhone和iPod touch开发,的UIColor 定义了一个 groupTableViewBackgroundColor 模式,你可以使用:

If you are developing for the iPhone and iPod touch, UIColor defines a groupTableViewBackgroundColor pattern that you can use:

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

您也可以在Interface Builder中找到这个颜色:

You can also find this color in Interface Builder:

这将不可用在iPad上,但是。你必须抓住自己的形象,做一个 UIColor.colorWithPatternImage:而不是

This won't be available on the iPad, however. You'll have to grab the image yourself and do a UIColor.colorWithPatternImage: instead.

这篇关于一个UIViewController的背景分组表视图颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆