UIColor hints (Cocoa touch)

I know that you came across if you were developing apps for the iPhone or Mac (NSColor). Here is a list with undocumented colors you may find it handy:

  • [UIColor pinStripeColor]
  • [UIColor underPageBackgroundColor]
  • [UIColor tableSelectionColor]
  • [UIColor textFieldAtomBlueColor]
  • [UIColor textFieldAtomPurpleColor]

Now if you want to use a template like a color, is quite easy and fun. You can easily improve your user interface just with a better looking background.

NSString *backgroundPath = [[NSBundle mainBundle] pathForResource:@”background-grouped-table” ofType:@”png”];UIImage *backgroundImage = [UIImage imageWithContentsOfFile:backgroundPath];UIColor *backgroundColor = [[UIColor alloc] initWithPatternImage:backgroundImage];tableView.backgroundColor = backgroundColor;  [backgroundColor release];


Last but not least, Gradient colors :) You will definitely use them. (So sexy)…

NSColor* gradientBottom = [NSColor colorWithCalibratedWhite:0.10 alpha:1.0];
NSColor* gradientTop    = [NSColor colorWithCalibratedWhite:0.35 alpha:1.0];
bgGradient = [[NSGradient alloc] initWithStartingColor:gradientBottom endingColor:gradientTop];

Friday, July 3, 2009   ()