8

I need to set the same gray stripped background to another view. Can anyone help me on this one?

Thanks, Leonardo

Homer1980ar
  • 277
  • 6
  • 15
  • possible duplicate of [is groupTableViewBackgroundColor deprecated on iOS 6?](http://stackoverflow.com/questions/12452810/is-grouptableviewbackgroundcolor-deprecated-on-ios-6) – Gordon Gustafson Aug 07 '13 at 13:41

2 Answers2

32

It's very easy :)

[self.view setBackgroundColor:[UIColor groupTableViewBackgroundColor]];
Jasarien
  • 58,279
  • 31
  • 157
  • 188
2

As of iOS 6.0 the given answer from Jasarien will not work anymore. Basically you need to place a UITableView in the background to accomplish what you want (do not forget to set the autoresizingMask or according contraints in Auto-Layout). You maybe also want to set the property userInteractionEnabled to NO so the user can not interact with your 'background color'.

Community
  • 1
  • 1
Patrik
  • 1,117
  • 12
  • 21