Tab bar High res icons don't get correctly sized.
Well, I'm trying to set an Hi-Resolution icon for my Tab bar as per Apple Human Interface Guidelines:
Tab bar icon (optional):
Approximately 30 x 30 (3G / 3GS)
Approximately 60 x 60 (high resolution)
So, I made great looking 60x60 icons and I'm trying to set it as Tabs but the icon gets too big and overlaps the Tab space.
I did try to set a lower size (standard 30x30) using size parameter with width/height dictionary and direct set width and height on the tab object. None of then worked though…
Can anybody give me a light on how can I use high-resolution 60x60 images as icons on my Tab bars ?
My code snippet:
var testTab = Ti.UI.createTab ({
title: "Test",
icon: "highres.png",
size: {width: 30, height: 30},
window: dronesWin
});
1 Answer
-
Accepted Answer
are you using the highres@2x.png file naming format? You should have 2 images:
tabicon.png
tabicon@2x.pngthen use them in code like this - the right image will be used transparently based on the screen density:
var testTab = Ti.UI.createTab ({ title: "Test", icon: "tabicon.png", window: dronesWin });