Hi, i'm making a app for android. For different android devices, i'm using density specific resources. My problem is when i put images in the density specific folders like res-hdpi under the Resources/android/images, i can't see those images. it i put those images directly to the Resources/android/images folder (instead of density specific folder under Resources/android/images), then i can see those images. Below is my code -
var homeWindow = Titanium.UI.createWindow({ backgroundColor : '#Green', fullscreen : true, exitOnClose : true }); var actionBar; homeWindow.addEventListener("open", function(e) { actionBar = homeWindow.activity.actionBar; if (actionBar) { actionBar.icon = "/images/TitleHorse.png"; actionBar.title = ""; } homeWindow.activity.onCreateOptionsMenu = function(e) { var menu = e.menu; var homeMenu = menu.add({ icon : "Home_Main.png",// i never see this for being in the desity specific folder showAsAction : Ti.Android.SHOW_AS_ACTION_ALWAYS }); var logoutMenu = menu.add({ icon : "/images/Logout.png",// i never see this or being in the desity specific folder showAsAction : Ti.Android.SHOW_AS_ACTION_ALWAYS }); logoutMenu.addEventListener("click", function(e) { // }); }; }); homeWindow.orientationModes = [Titanium.UI.PORTRAIT, Titanium.UI.LANDSCAPE_LEFT, Titanium.UI.LANDSCAPE_RIGHT]; var scrollView = Ti.UI.createScrollView({ //backgroundColor: 'green', layout : 'vertical', contentWidth : Ti.UI.SIZE, contentHeight : Ti.UI.SIZE, showVerticalScrollIndicator : true, //showHorizontalScrollIndicator : true, height : '100%', width : Ti.UI.FILL, top : '0dp' }); var HomeTitleLabel1 = Ti.UI.createLabel({ //backgroundColor: 'green', color : '#FFF', text : 'Welcome to My App', font : { fontFamily : 'Arial', fontWeight : 'bold', fontSize : '18dp' }, textAlign : 'center', top : '20dp', height : Ti.UI.SIZE, width : '250dp' }); scrollView.add(HomeTitleLabel1); var username = Titanium.UI.createTextField({ backgroundColor : '#FFF', color : '#336699', value : '', top : '20dp', height : Ti.UI.SIZE, width : '250dp', hintText : 'Username', font : { fontFamily : 'Arial', fontWeight : 'bold', fontSize : '14dp' }, keyboardType : Titanium.UI.KEYBOARD_DEFAULT, returnKeyType : Titanium.UI.RETURNKEY_DEFAULT, borderStyle : Titanium.UI.INPUT_BORDERSTYLE_ROUNDED }); var password = Titanium.UI.createTextField({ backgroundColor : '#FFF', color : '#336699', value : '', top : '10dp', height : Ti.UI.SIZE, width : '250dp', hintText : 'Password', font : { fontFamily : 'Arial', fontWeight : 'bold', fontSize : '14dp' }, passwordMask : true, keyboardType : Titanium.UI.KEYBOARD_DEFAULT, returnKeyType : Titanium.UI.RETURNKEY_DEFAULT, borderStyle : Titanium.UI.INPUT_BORDERSTYLE_ROUNDED }); var HomeImg = Titanium.UI.createImageView({ width : 100, height : 100, image : "/images/Horse.png",//if this image is in Resources/android/images then i can see this. but if it is in density specific folder like res-hdpi under Resources/android/images then i can't see this. opacity : 1, }); scrollView.add(username); scrollView.add(password); scrollView.add(HomeImg); homeWindow.add(scrollView); homeWindow.open();i think my main problem is with the settings of density specific folder hierarchy. i'm giving my github url. please see and inform me where i'm mistaking. please help me out. thanks.
https://github.com/rruhan/horse-list