Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom UIToolBar from Images

I need to create a UIToolbar object that uses an image for the background. Most of the buttons are images as well, and rectangular. One button, however, is round and overlaps the toolbar like the Start button on the Windows task bar. See below.

I know that I will need to subclass the UIToolbar to paint the image for the toolbar -- I think. If so, does anyone have example code showing how to do this?

Furthermore, does anyone have any ideas on how to implement the larger round button? I'm thinking of another custom subclass for this, but not sure if there might be an easier way.

I can have the art guys chop the image anyway needed, which I'm sure the round button will need to be chopped some how.

Any ideas or sample code?

alt text http://iphone.sophtware.com/toolbar.png

like image 417
Sophtware Avatar asked May 05 '10 00:05

Sophtware


2 Answers

Maybe you'll find some inspiration at this tutorial : Recreating The Raised Center Tab Bar Button of Instagram, DailyBooth & Path

like image 72
Pfitz Avatar answered Sep 21 '22 06:09

Pfitz


For the color, you can experiment with the tintColor property.

As for the rest, UIToolbar is not designed for this. You will need a custom component (probably based on UIView).

like image 21
Eiko Avatar answered Sep 19 '22 06:09

Eiko