views:

516

answers:

1

Hi there

I did add a toolbar to my UINavigationController and that works as it should. But I don't see any possibility to change the appearance(like other backgroundcolor etc.) of the toolbar.

The docs shows me that an UINavigationController has a toolbar property but it is readonly.

Do I have to do an custom UIView or is there any other given way?

cheers cyril

+2  A: 

While the toolbar property itself may be readonly, it's properties are as they are normally.

The toolbar being readonly means that you can't set a different instance of a toolbar for that property. The toolbars properties, such as it's barStyle are readwrite and are modifiable.

Simply call:

myNavController.toolbar.barStyle = UIBarStyleBlackOpaque; // exchange this style constant for whatever you want to use.
Jasarien
ahhh right. just read readonly and didn't think of it.thx a lot
gabac