1

This is probably something very easy and stupid of me but I have a custom UINavigationBar that customized it with core graphics in the drawrect method. I use it multiple times throughout my app and all but two instances work fine. The two instances when loaded into view are rendering black when they should be a gray gradient. The drawrect method is being called but for some reason they are being presented black in the view.

These are the IB settings I have for the UINavigationBar

enter image description here

And the settings I have for the parent UIVIew

enter image description here

If theres any other information I can provide to make this easier please just let me know. Thanks a lot for anyone that can help.

Ignacio Correia
  • 3,611
  • 8
  • 39
  • 68
JLoewy
  • 535
  • 1
  • 4
  • 17
  • Is this a subclass of UINavigationBar, or are you overriding drawRect in a category? why aren't you using the UIAppearance methods? – jrturton Dec 28 '12 at 18:09
  • I'm subclassing UInavigationBar – JLoewy Dec 28 '12 at 18:31
  • AFAIK, UI Appearance can only use UIImage instances to customize appearance for navigation bars. The only way I can think of to use custom drawing in conjunction with UI Appearance would be to do the drawing into an image context and then use the resulting UIImage. See: http://stackoverflow.com/questions/12864223/cg-drawing-in-uiview-to-use-as-uiimage – nickbona Jan 04 '13 at 18:45
  • I actually went ahead and used the UIAppearance methods like jrturton suggested. Thanks a lot guys – JLoewy Jan 04 '13 at 18:53

0 Answers0