Lack of tab icons for android

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

I have just started with appcelerate, and I cannot get the icons to appear on the tabs in my android. I am running the simplest of apps, taken from the examples:

module.exports = ApplicationTabGroup;

function ApplicationTabGroup() { var self = Ti.UI.createTabGroup();

var fugitiveWindow = Titanium.UI.createWindow ({
    height:Titanium.UI.FILL,
    width:Titanium.UI.FILL
});

var fugitiveTab = Titanium.UI.createTab({
    title:L('fugitive_title','tab1'),
    icon:'images/fugitives.png',
    window:fugitiveWindow
});

fugitiveWindow.containingTab = fugitiveTab;
self.addTab(fugitiveTab);

var capturedWindow = Titanium.UI.createWindow ({
    height:Titanium.UI.FILL,
    width:Titanium.UI.FILL
});

var capturedTab = Titanium.UI.createTab ({
    title:L('captured_title','tab2'),
    icon:'images/captured.png',
    window:capturedWindow
});

capturedWindow.containingTab = capturedTab;
self.addTab(capturedTab);

self.setActiveTab(1);

return self;

}

I have added "<property name="ti.android.fastdev" type="bool">false</property>" to TiApp.xml and the images are transparent, the case of the file names are correct and I am running Titanium Studio, build: 2.1.2.201208301612.

I would appreciate it if someone can explain what I am doing wrong!

1 Answer

Accepted Answer

icon:'/images/fugitives.png',

Try prefacing your image references with a leading slash for Android.

— answered 10 months ago by Stephen Feather
answer permalink
2 Comments
  • iOS seems to assume you are referencing from project root, while Android assumes you are referencing from the location of the calling JS file.

    — commented 10 months ago by Stephen Feather

  • Thanks! I had to add the leading slash, and also I had the image directory one level to high, it needed to be under the Resources directory not the project directory.

    — commented 10 months ago by Richard George

Your Answer

Think you can help? Login to answer this question!