How can I create an iOS-style toolbar in my Mac Cocoa application?
Several iLife '11 applications on the Mac use iOS-style black toolbars. For instance, the toolbar at the bottom of this screenshot of iPhoto:
(source: pocket-lint.com)This sort of look is available in the iOS SDK as "UITabBar."
I am wondering if there is an easy way to achieve th开发者_Python百科is in my ordinary, non-iOS Mac application. If not, what would be the best way to go about creating this effect?
There's nothing that will give you this view out of the box. You'll need to build it yourself.
The simplest method would be to create a custom view with a gradient background and place monochrome buttons in it.
Better would be to create a set of classes similar to NSToolBar
that handle positioning, highlighting etc. Even better, build it and then open-source it :-)
However, you'll have to build it yourself. Apart from NSButton
there's not much that will help in the pre-existing objects.
精彩评论