Domanda

The Designing Toolbar Icons' section of OS X Human Interface Guidelines says that the system applies effects on icons in the toolbar that change their appearance. In other words, we have to create a solid black icon like this:

Solid black icon

and the system displays it like this:

System processed icon

That's great, but it does not work for me.

I'm using Interface Builder. I have a Rounded Textured Button inside a NSToolbarItem:

Interface Builder Hierarchy

I have assigned a solid black icon to the toolbar item:

enter image description here

When I show it, however, it appears like a... solid black icon:

enter image description here

What am I doing wrong? This thing is driving me crazy.

È stato utile?

Soluzione

Try to rename your icon from Test to TestTemplate. You can find more information about this trick in OS X Release Notes.

Altri suggerimenti

If you are dealing with an NSImage object directly (not in Interface Builder) you can call [myImage setTemplate:YES] and it will exhibit the special drawing behavior.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top