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

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

    You can do it like this if you know which classes contain the translucent bars:

    [[UIBarButtonItem appearanceWhenContainedIn:[MyClassWithTranslucentBar class], [MyOtherClassWithTranslucentBar class], nil]
        setTintColor:desiredColor];
    

提交回复
热议问题