Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

isparkdev

macrumors newbie
Original poster
Jun 1, 2009
1
0
Hi,
Is it possible to change background color of uitableview (style grouped) while still preserving the texture of vertical lines.
If i change background color the texture is lost & i get a plain background.
 
Code:
[UIColor [URL="http://developer.apple.com/iphone/library/documentation/uikit/reference/UIColor_Class/Reference/Reference.html#//apple_ref/occ/clm/UIColor/groupTableViewBackgroundColor"]groupTableViewBackgroundColor[/URL]]
 
The grouped table view background colour is actually a pattern. If you want to create your own custom version of the default pattern you could capture a small 'tile' (for this pattern the smallest possible tile would be two columns wide, 1 pixel down) and then open it up in a paint program and change the colours to whatever you want.

Then create your own colour using the new pattern:

Code:
tableView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"mypattern.png"]];

(Note that UIImage's imageNamed: method is pure evil but on an image size of about 4 x 1 pixels it will not cause you any memory issues).
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.