Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

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

— asked December 3rd 2010 by Ygor Lemos
  • icon
  • ios
  • iphone
  • retina
  • tab
  • tabbar

1 Answer

  • Accepted Answer

    are you using the highres@2x.png file naming format? You should have 2 images:


    then 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 
    — answered December 3rd 2010 by Kevin Whinnery
    1 Comment
    • Thought it just work for app icon and startup images, not for tabs, glad to know that :)
      Testing now!

      — commented December 3rd 2010 by Ygor Lemos
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.