[Android] Menu Icon

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

Hello folks.. i got problem here.. I see that in android when i set image to a 160dp device the 16x16 menu icon is visible and looking good.. but when i put the app to a 240dp device.. the icon is too small to see... I guess it will be solved in using /android/images different densities.. so.. how am i gonna do that?? just do if then else for the images if the density is 160? or 240?? Thanks.. for helping..

2 Answers

Here is some documentation that might help https://wiki.appcelerator.org/display/guides/Using+density-specific+resources+on+Android

I solved this problem by identifying density of the phone then set the proper Icon that match to each density

exports.iconMenu = function(menu,name){
    switch(Titanium.Platform.displayCaps.dpi){
        case 120:
            menu.setIcon('/menuicon/' + name + '_25x25.png');
        break;
        case 180:
            menu.setIcon('/menuicon/' + name + '_60x60.png');
        break;
        case 240:
            menu.setIcon('/menuicon/' + name + '_110x110.png');
        break;
    }
}
then poof.. its ok now :)

Your Answer

This question has been locked and cannot accept new answers.