4

I was wondering if anyone knows how to setup a new textured color in the palette. See the image below.

background colors

I tried to click on Other.... and then put a image palette on. like so:

enter image description here

So now I can select only one pixel out of it. I wish I could select more. It would make the work a lot easier instead of setting the background programatically every time. If you have any suggestions of things I can try such as files to override or anything please help... Thanks.

Programatically is kinda easy. But I'm making a universal app (iphone and Ipad) and... well there must be a way around it. Here's how I do it programatically:

UIImage *wood = [UIImage imageNamed:@"woodenBack.png"];
self.tableView.backgroundColor = [UIColor colorWithPatternImage:wood];
Farini
  • 923
  • 1
  • 18
  • 35
  • Why dont you set table background image "woodenBack.png"? – Rupesh Mar 20 '12 at 06:02
  • Are you trying to use a different image between iPhone / iPad? You might just have to bite the bullet and do this in code. – pzearfoss Mar 25 '12 at 18:34
  • Yeah apparently... I wish it was easier though. They have some other ones ready. but thanks for trying to help – Farini Mar 27 '12 at 01:29
  • 1
    you can subclass a tableview controller suppose MYTableViewController and just put your background image code into viewdidload and extend your MYTableViewController to every tableviewcontroller. it will have your default image in all. :) – iNeal Jun 22 '12 at 06:48
  • Can use something like this, BOOL large = ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad); // Page thumb size if(large){ UIImage *wood = [UIImage imageNamed:@"woodenBack.png"]; self.tableView.backgroundColor = [UIColor colorWithPatternImage:wood]; }else{ UIImage *brick = [UIImage imageNamed:@"brick.png"]; self.tableView.backgroundColor = [UIColor colorWithPatternImage:brick]; } – Lalith B Aug 10 '12 at 08:41

1 Answers1

1

Can use something like this,

BOOL large = ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad); // Page thumb size

if(large){
UIImage *wood = [UIImage imageNamed:@"woodenBack.png"];
self.tableView.backgroundColor = [UIColor colorWithPatternImage:wood];
}else{
UIImage *brick = [UIImage imageNamed:@"brick.png"];
self.tableView.backgroundColor = [UIColor colorWithPatternImage:brick];
}

if the background persists across all views then you can possibly apply the background to the UIWindow in your appdelegate and set background color clear color in the rest of the views.

Another approach is to loop and browse through the subviews and find tableview and apply background to the tableview, but I guess this is a CPU intensive task and it is better to have image loaded using code.

Lalith B
  • 11,843
  • 6
  • 29
  • 47
  • 1
    lalith I understand your answer nad Yeah, it can be done that way. But what I really want to know is how to change the options of the textured backgrounds that comes with the xcode. Like in photoshop if it's possible to just add your own background to the preset of available backgrounds. Cheers! – Farini Aug 15 '12 at 00:21