UINavigationBar and new iOS 5 appearance API - how to supply two background images?

At the moment, there's no way to do what you're describing - the appearance proxy doesn't know anything about any particular instance at the time you're calling for it In practical terms, what you'll probably need to do is figure out how many translucent bars you'd have v. How many non-translucent ones you had. Choose whichever you have more of and use the appearance proxy for that one - for the others, when you go to make it translucent (or ask for full-screen layout), you'll have to set the background image then In the meantime, could you file an enhancement request at bugreport.apple.com for what you're asking?

It's not an unreasonable request. Thanks!

At the moment, there's no way to do what you're describing - the appearance proxy doesn't know anything about any particular instance at the time you're calling for it. In practical terms, what you'll probably need to do is figure out how many translucent bars you'd have v. How many non-translucent ones you had.

Choose whichever you have more of and use the appearance proxy for that one - for the others, when you go to make it translucent (or ask for full-screen layout), you'll have to set the background image then. In the meantime, could you file an enhancement request at bugreport.apple.com/ for what you're asking? It's not an unreasonable request.

Thanks!

Yep, that's pretty much what I've figured out over the last few minutes... thanks. – Mark Beaton Oct 14 at 0:17.

You can either set it globally with the class appearance proxy or set it on an instance of a navBar. I'm currently setting background on an instance of the nav bar and it seems to be working. I have two different navBars with different backgrounds.

If you set it on an instance, you should be able to condition the code. UINavigationController *myNavController = UINavigationController alloc initWithRootViewController:myView; viewControllers addObject:myNavController; // not supported on iOS4 UINavigationBar *navBar = myNavController navigationBar; if (navBar respondsToSelector:@selector(setBackgroundImage:forBarMetrics:)) { // right here, you could condition bg image based on properties of this instance // of the navBar or any other condition. NavBar setBackgroundImage:UIImage imageNamed:@"bg.

Jpg" forBarMetrics:UIBarMetricsDefault; } If you want to set using the class method, you can set for all: UINavigationBar appearance setBackground ... I will admit though that it's pretty new and I'm just figuring it out like most folks.

I'm trying to achieve this globally though, for any UINavigationBar instance, so the instance methods won't cut it - essentially, I want to use the class method, but have it set a different image based on the translucent property's value when the appearance proxy applies itself to each instance... I think I'm probably out of luck... – Mark Beaton Oct 14 at 0:15 I'm not aware of a way to do that other than do it on the instance level - that does have you littering your code bu you could have a common method that does that. – bryanmac Oct 14 at 0:17 The other thing I was looking at was appearanceWhenContainedIn but I don't think that helps you either since that's more about the type of view it's under to control which appearance to use ... – bryanmac Oct 14 at 0:18.

At the moment, there's no way to do what you're describing - the appearance proxy doesn't know anything about any particular instance at the time you're calling for it. In practical terms, what you'll probably need to do is figure out how many translucent bars you'd have v. How many non-translucent ones you had.

Choose whichever you have more of and use the appearance proxy for that one - for the others, when you go to make it translucent (or ask for full-screen layout), you'll have to set the background image then. In the meantime, could you file an enhancement request at http://bugreport.apple.com/ for what you're asking? It's not an unreasonable request.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions