Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set the same default background of the UITableView to a custom view controller

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

Thanks, Leonardo

like image 845
Homer1980ar Avatar asked Jan 22 '10 16:01

Homer1980ar


2 Answers

It's very easy :)

[self.view setBackgroundColor:[UIColor groupTableViewBackgroundColor]];
like image 194
Jasarien Avatar answered Dec 09 '22 20:12

Jasarien


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'.

like image 45
Patrik Avatar answered Dec 09 '22 21:12

Patrik