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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/luketheh%40apple.com

This email sent to luket...@apple.com

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to