Background of a UIViewController to Grouped table

2019-02-28 09:15发布

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?

2条回答
萌系小妹纸
2楼-- · 2019-02-28 09:33

...or you could use the pattern color that groupTableViewBackgroundColor itself references:

[UIColor pinStripeColor]

this works equally well on iOS6...

查看更多
小情绪 Triste *
3楼-- · 2019-02-28 09:35

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

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

You can also find this color in Interface Builder:

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

查看更多
登录 后发表回答