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

后端 未结 6 1988
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-05 00:50

I want to exploit the new iOS 5 appearance API to supply custom background images to all UINavigationBar instances in my app. To do this, it\'s as simple as this:

         


        
6条回答
  •  失恋的感觉
    2021-01-05 01:25

    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. Thanks!

提交回复
热议问题