Subclassing UINavigationBar … how do I use it in UINavigationController?

后端 未结 3 1252
伪装坚强ぢ
伪装坚强ぢ 2021-02-06 06:26

I wanted to subclass UINavigationBar (to set a custom background image & text color) and use that for all the navigation bars in my app. Looking at the API docs for UINaviga

相关标签:
3条回答
  • 2021-02-06 06:55

    Try creating a [UIColor colorWithPatternImage:(UIImage*)image] and setting it to the NavBar's backgroundColor property. I haven't tried this yet, but I will do it right now.

    0 讨论(0)
  • 2021-02-06 07:09

    I dunno if you got this figured out. But for others that might have this problem...

    What you need to do is to specify the class in your XIB to your class name (in this case MyNavigationBar.

    Check session 123 in WWDC 2011.

    0 讨论(0)
  • 2021-02-06 07:15

    Set the UINavigationBar "tint" property to the color you want.

    0 讨论(0)
提交回复
热议问题