• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: UINavigationBar, setTintColor: and UIColor colorWithPatternImage:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: UINavigationBar, setTintColor: and UIColor colorWithPatternImage:


  • Subject: Re: UINavigationBar, setTintColor: and UIColor colorWithPatternImage:
  • From: Luke the Hiesterman <email@hidden>
  • Date: Wed, 9 Dec 2009 06:49:05 -0800

Do you really expect that a patterned image would work well in this case? A tint obviously gets applied to the color that is set to create the actual background, and remember that the background of the bar gets mirrored in any buttons on the bar, which seems destined to look awkward if we're talking about an image other than a tinted color. You may want to think hard about why you want an image in the background of a nav bar, and remember that you can always have a translucent navigationBar.

Luke

On Dec 9, 2009, at 6:34 AM, Duccio wrote:

Related to "[iPhone] UINavigationController and UINavigationBar".
-----------------------------------------------------------------

Instantiating a color using colorWithPatternImage:

UIColor *color = [UIColor colorWithPatternImage:[UIImage imageNamed:@"image.png"]];

and using it to set the tintColor of a UINavigationBar:

	[self.navigationController.navigationBar setTintColor:color];

the navigation bar is all black (with a small light effect on the top, the same as [self.navigationController.navigationBar setTintColor:[UIColor blackColor]]) with no image on it.

Using instead the color to "fill" the view of my view controller works ([self.view setBackgroundColor:color]) so UIColor colorWithPatternImage: is working.

The UIColor documentation says:

colorWithPatternImage:

You can use pattern colors to set the fill or stroke color just as you would a solid color.

So, why I can't use on my UINavigationBar?

Thanks
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >UINavigationBar, setTintColor: and UIColor colorWithPatternImage: (From: Duccio <email@hidden>)

  • Prev by Date: Re: CAShapeLayer and touches?
  • Next by Date: launchApplication: giving error -10827 ?
  • Previous by thread: UINavigationBar, setTintColor: and UIColor colorWithPatternImage:
  • Next by thread: launchApplication: giving error -10827 ?
  • Index(es):
    • Date
    • Thread