Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I make toolbars that look like the ones in Keynote?

Here's a screenshot of keynote on the ipad:

alt text
(source: scottyallen.com)

The toolbar is pretty flat - it doesn't have a vertical gradient the way the builtin toolbar styles do. I've played with the different styles, the translucent flag, and the tint color, and haven't been able to replicate it.

How are they doing this? How would I implement it?

like image 270
Scotty Allen Avatar asked Jul 18 '10 05:07

Scotty Allen


People also ask

How do you make a point appear one by one in Keynote?

Build objects one piece at a time Select a table, chart, or block of text (for example, a list or text with some paragraphs). Click Animate in the toolbar. Click Add an Effect, then choose an animation. Click the Delivery pop-up menu, then choose how you want the object to build.


1 Answers

I think your talking about the UIToolbar on top, not the toolbar-ish controls at the bottom.

Changing the looks of a UINavigationBar or UIToolbar is really easy, you can just use an image instead of the calculated tintColor and default gradient.

To do this, you'll need to subclass (or make a category of) the UINavigationBar or UIToolbar and overwrite the drawRect: method, like this:

- (void)drawRect:(CGRect)rect {
    UIImage *image = [UIImage imageNamed:@"toolbarBackground.png"];
    [image drawInRect:rect];
}

This image then gets drawn at the exact rect of the UINavigationBar or UIToolbar, functioning as a background image.

like image 149
Douwe Maan Avatar answered Sep 24 '22 22:09

Douwe Maan