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

后端 未结 6 1986
爱一瞬间的悲伤
爱一瞬间的悲伤 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:26

    This answer probably won't be of much help to you, but it may be to others. IF you make a subclass, you can specify the appearance for each subclass separately. For instance, I have UITableviewCells and a custom class that is derived from UITableViewCells. I actually do this for a reason, but I discovered that i need to call [[UITableViewCells appearance] setFont:[...]] for both classes specifically.

    Since you seem to want to do so based upon a variable that you will not know until runtime, you are probably out of luck!

提交回复
热议问题