Sometimes it is really necessary to have a transparent UIToolBar within you iPhone app. Especially if you want to add a UIToolBar to your UINavigationBar you get some problems with overlaying backgrounds ( UIBarStyleBlackOpaque did not work for a toolbar on a black opaque navigation bar).

A quick and pragmatic solution is to subclass UIToolBar and do some modifications. The following code is everything you need to get a really transparent tool bar:

To apply a color to the including UIBarButtonItems you can set the bar style as usual.

Leave a Reply

电子邮件地址不会被公开。 必填项已用*标注