Hi,
I've been trying really simple examples as i'm new to titanium.
My problem is that in the examples i'v run (and even the default project created with 2 tabs), Icons or images for tabs never show ! I've search the QA, found somes questions same as this one but with no responses!
here is the code of default project which also doesn't show tabs icons :
///////////////////////////
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_views.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();
//////////////////
I'm testing this code on android emulator, tryed many versions of android emulators (since 1.6 up to 2.3.3) the result is the same !
any clues?
9 Answers
Ok, I found the answer here:
http://developer.appcelerator.com/question/122666/tab-icons-not-showing-up-on-android-emulator-absolute-and-relative-path-doesnt-work#comment-104715
And this worked fine for me. Now I can see my icon in the tabs. Just changed in tiapp.xml adding this line:
<property name="ti.android.fastdev" type="bool">false</property>
Where are your icons stored? If they are in an 'img' folder within the 'resources' folder of your project, for example, then (on Android) you should write:
icon: 'img/KS_nav_ui.png'
Laurent
Hi Laurent,
My icons are directly stored at the resources directory : Resources/KS_nav_views.png
but i tryed also creating a new images directory like Resources/images/KS_nav_views.png
the point at it this way icon:'images/KS_nav_views.png'
but still nothing is ok
some people talked about the build operation that doesn't copy 'those' pictures but i don't know what i can do.
Try to force Titanium to do a full rebuild of your program: go to the build>android directory and put everything in the trash. Then launch your program again.
Laurent
I just did that about 3 times,
i could check that the directoy build/android/bin/assets/Resources contains all images there is another directory build/android/res/draable that cotains only the app icon and splach screen but not the tabs icons.
it's little problematic for an icon issue.. :s
I'm also having this issue, any update on this? I already spent much time on this but can't still figure out.
Any help is very much appreciated.
Thank you.
Same here, i cant get the icons to show on any tab. I have tried:
-clean & rebuilt
-relocate image files
-close every single thing and start all again.
-clear folder build>android directory
None of the above action shows the icon. is there any solution for this?
Versions: Titanium Studio, build: 1.0.4.201108101535
AVD: Google API lvl-10 2.3.3 HVGA
I'm having the same problem here. Worse than that, I have this problem with the simplest Titanium "Hello World" app. Does this simple problem has a solution?
Hi, it looks like its been a while since this discussion took place, but I had the same issue and the issue appears to be with how I designed my icons. Apparently, we can't take just any .png file and place it in our resources directory, or subsequent img or iPhone/Android directories. I tried creating my own and some worked, while some did not, also, I searched and downloaded some icons. Finally, I was able to get these icons to show up consistently by downloaded the icons from http://glyphish.com
I tested these and they worked, every single one of them. I would try downloading the free ones to test. We probably need similar file specs for our .png files if we want to crate our own.
Your Answer
Think you can help? Login to answer this question!