tab icons not showing up on android emulator, Absolute and Relative path doesn't work

You must Login before you can answer or comment on any questions.

Hi guys, any idea of any fix to this issue? I'm having trouble showing the icons on the tab, and also adding absolute and relative path doesn't either fix the issue.

I also tried running the kitchen sink sample and same thing happens. Icons won't show up. Any idea guys?

I'm using Android 2.2 running on windows 7 and Latest Titanium Studio.

Any help is very much appreciated.

  • Mark

5 Answers

Accepted Answer

Turn off fast dev in tiapp.xml, run it again and they will show. I found fastdev images dont pick up if they are new or changed, or in the tabs. So I turn fastdev off when working on new image things, and before deploying to my test unit.

— answered 2 years ago by Steve Hovey
answer permalink
4 Comments
  • works perfectly! Thank you very much.

    — commented 2 years ago by Jesse Johnstone

  • How do you disable it? I don't see an option for it listed.

    — commented 2 years ago by Chris Ditty

  • Thank you very much Steve!! It worked fine for me.

    Chris, try this:

    <property name="ti.android.fastdev" type="bool">false</property>
    in tiapp.xml

    — commented 2 years ago by José Júnior

  • Show 1 more comment

Post some code

— answered 2 years ago by Dan Tamas
answer permalink
1 Comment
  • Hi Dan, thanks for your quick response.

    Here is the code that I'm using, actually this is the default code that is generated by Titanium Studio. I tried changing the value of the icon attribute of the tab, changing it to relative and absolute path but none of them work.

    And also I found out just now that when using external path like http://www.yoursite.com/icon.png works, this is the only thing works. Accessing images on my local drive doesn't work.

    Any help will really really be appreciated.

    Thank you

    // this sets the background color of the master UIView (when there are no windows/tab groups on it)
    Titanium.UI.setBackgroundColor('#000');
     
    // create tab group
    var tabGroup = Titanium.UI.createTabGroup();
    //
    // create base UI tab and root window
    //
    var win1 = Titanium.UI.createWindow({  
        title:'Tab 1',
        backgroundColor:'#fff'
    });
    var tab1 = Titanium.UI.createTab({  
        icon:'KS_nav_ui.png',
        title:'Tab 1',
        window:win1
    });
     
    var label1 = Titanium.UI.createLabel({
        color:'#999',
        text:'I am Window 1',
        font:{fontSize:20,fontFamily:'Helvetica Neue'},
        textAlign:'center',
        width:'auto'
    });
     
    win1.add(label1);
     
    //
    // create controls tab and root window
    //
    var win2 = Titanium.UI.createWindow({  
        title:'Tab 2',
        backgroundColor:'#fff'
    });
    var tab2 = Titanium.UI.createTab({  
        icon:'KS_nav_ui.png',
        title:'Tab 2',
        window:win2
    });
     
    var label2 = Titanium.UI.createLabel({
        color:'#999',
        text:'I am Window 2',
        font:{fontSize:20,fontFamily:'Helvetica Neue'},
        textAlign:'center',
        width:'auto'
    });
     
    win2.add(label2);
     
    //
    //  add tabs
    //
    tabGroup.addTab(tab1);  
    tabGroup.addTab(tab2);  
     
    // open tab group
    tabGroup.open();

    — commented 2 years ago by Jesse Johnstone

Try to use Ti SDK 1.7.1 - it makes the paths consistent on both platforms. The paths are relative to the Resources folder, and on the device the filenames( and folders ) are case sensitive.

— answered 2 years ago by Dan Tamas
answer permalink
1 Comment
  • Hi Dan, I'm already using Ti SDK 1.7.1. I tried upgrading to SDK 1.7.2 for android but same thing happens. I even downgraded to 1.6.3 but no luck.

    — commented 2 years ago by Jesse Johnstone

You can check it out here. i hope it help you

— answered 2 years ago by sayed fathey
answer permalink
1 Comment
  • Hi Sayed, the fix still doesn't work for me. Maybe it is a bug on the Ti 1.7.x running on windows that needs to look at by the Ti team?

    — commented 2 years ago by Jesse Johnstone

I'm on 1.7.1 and am running into the same issue i.e. when I reference a different image file, in the same path as the default image, for the tab icon it doesn't show. The default image file referenced by the Ti starter code works.

— answered 2 years ago by Avi
answer permalink
2 Comments
  • Maybe a full rebuild might help you. Did you try going to Project menu => Clean? After cleaning the project and when you run again your app, it will try to force rebuild. Hope it helps you.

    — commented 2 years ago by Memark Barolo

  • Hey Memark - It would appear that the issue has something to do with the state of the build which could be why it's picking up the image in the default project and not picking up my custom image. I had tried with a clean build earlier, but that didn't work either.

    — commented 2 years ago by Avi

Your Answer

Think you can help? Login to answer this question!