O'Reilly logo

iPhone JavaScript Cookbook by Arturo Fernandez Montoro

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a button for the toolbar

The toolbar bar can contain simple buttons as well, not only navigation buttons. For instance, the Cancel button is very common and the status bar can be the right place for it. This kind of button is different; we don't need any arrow or icon. A rounded button with a simple text is enough for the purpose.

Getting ready

Once again, iWebKit will be our framework for this new recipe.

How to do it...

It's possible to put our new button on the left or on the right inside the toolbar. We only need to use a specific attribute, which identifies a CSS style defined in the style.css file of the framework.

To put the button on the left, we'll add the following line inside the div with the id="topbar" and below the titlediv ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required