How do I change the background of a UINavigationBar?
问题 I'd like to change the background of my UINavigationBar to a [UIColor colorWithImage:] , but it isn't working. What am I missing? EDIT: Once I've created my subclass, where do I set the UINavigationController to use it? 回答1: You can use the tintColor property to change the colour of a UINavigationBar , but to set an image as the background you'll have to provide your own UINavigationBar subclass and override the drawRect: method, for example: - (void)drawRect:(CGRect)rect { // Drawing code