I have an iOS6 iPhone application, with a Tabbar and tabbar buttons. These buttons need icons and that's where the trouble starts. Added one icon to the project, double clicked on a button in the designer and associated the (questionmark) icon via the image combobox to the button. When I run the app on my iPhone, I do indeed see that the button now does indeed display a gradient-gray square, which turns into a gradient light-blue square, but the questionmark icon is not shown. The icon is a .png and the size is width 40, height 51. I changed nothing in the code.
1
votes
Looks like somebody had the same problem here: discussions.apple.com/thread/…
– jhulst
From that link: "In other words, the actual colours of your image are ignored. The only interesting thing about each pixel, as far as UITabBarItem is concerned, is whether it's transparent or not. The behaviour you are seeing is what will happen if you are using an image that is full of opaque pixels - in other words, what a normal, rational human being would think of as "an image". How you make pixels transparent depends on the image editing program you are using."
– jhulst
So it looks like I need to make the pixels of my icon 'transparent', what ever that may mean. Does anybody know of a (large) set of public domain icons with 'transparent pixels'? Or alternatively, how I make them transparent myself?
– jhulst
That problem has been discussed here before: stackoverflow.com/questions/813096/…
– jhulst
The official Apple documentation provides sample code, including icons: developer.apple.com/library/ios/#samplecode/NavBar/Introduction/… Yet even these icons, like Icon-Small.png + [email protected] lead to the same result: default grey area + lightblue if selected.
– jhulst