emulator giving with code..an image not supporting.

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

hi all.....please try to help me for this problem. i have a code in which the main window ,is not working with a image but if i change the image with another it work well. what would be the problem.i m using Google API android 2.2. and i check the all settings.if i increase the SD card capacity or ram size..then my other program also stop working.

var win = Titanium.UI.createWindow({ width : 320, height : 480, top : 0, left : 0, backgroundImage : 'background.png', //<<<<<<<<this image is giving problem }); var view = Ti.UI.createView({ width : 320, height : 480, left : 0, top : 0, backgroundImage : 'background.png', }); win.add(view);

//......................................top image view.............. var topimageview = Ti.UI.createView({ width : 320, height : 55, left : 0, top : 0, }); view.add(topimageview);

var topimage = Ti.UI.createImageView({ image : 'Bar.png', width : 320, height : 55, top : 0, left : 0, }); topimageview.add(topimage);

var topimageLabel = Ti.UI.createLabel({ text : 'Step 3: Financial Aid', color : '#fff', font : { fontSize : 20, fontWeight : 'bold', fontFamily : 'AlteHaasGroteskRegular' }, height : 25, width : 'auto', top : 10, textAlign : 'center' }); topimageview.add(topimageLabel);

//...........................................tabgroup view................... var tabgroupview = Ti.UI.createView({ width : 320, height : 50, left : 0, top : 50 }); view.add(tabgroupview);

var tab1 = Ti.UI.createView({ width : 79, height : 50, left : 0, top : 0, }); tabgroupview.add(tab1); var vltab1 = Ti.UI.createView({ width : 1, height : 40, left : 79, top : 5, backgroundColor : '#696969', }); tabgroupview.add(vltab1);

var tab2 = Ti.UI.createView({ width : 79, height : 50, left : 80, top : 0, }); tabgroupview.add(tab2); var vltab2 = Ti.UI.createView({ width : 1, height : 40, left : 159, top : 5, backgroundColor : '#696969', }); tabgroupview.add(vltab2); var tab3 = Ti.UI.createView({ width : 79, height : 50, left : 160, top : 0, }); tabgroupview.add(tab3); var vltab3 = Ti.UI.createView({ width : 1, height : 40, left : 239, top : 5, backgroundColor : '#696969', }); tabgroupview.add(vltab3);

var tab4 = Ti.UI.createView({ width : 79, height : 50, left : 240, top : 0, }); tabgroupview.add(tab4); //.....................................tab images..................... var tabimage = Ti.UI.createImageView({ image : '2.png', width : 25, height : 25, top : 8, }); tab1.add(tabimage); var tabimage = Ti.UI.createImageView({ image : '2.png', width : 25, height : 25, top : 8, }); tab2.add(tabimage); var tabimage = Ti.UI.createImageView({ image : '2.png', width : 25, height : 25, top : 8, }); tab3.add(tabimage); var tabimage = Ti.UI.createImageView({ image : '2.png', width : 25, height : 25, top : 8, }); tab4.add(tabimage);

//..............................................label on tabs.............. var label1 = Ti.UI.createLabel({ width : 'auto', height : 15, top : 32, text : '1.College', color : '#949494', font : { fontSize : 8, fontWeight : 'bold', fontFamily : 'AlteHaasGroteskRegular' }, textAlign : 'center' }); tab1.add(label1);

var label1 = Ti.UI.createLabel({ width : 'auto', height : 15, top : 32, text : '2.Expenses', color : '#949494', font : { fontSize : 8, fontWeight : 'bold', fontFamily : 'AlteHaasGroteskRegular' }, textAlign : 'center' }); tab2.add(label1); var label1 = Ti.UI.createLabel({ width : 'auto', height : 15, top : 32, text : '3.Financial Aid', color : '#949494', font : { fontSize : 8, fontWeight : 'bold', fontFamily : 'AlteHaasGroteskRegular' }, textAlign : 'center' }); tab3.add(label1); var label1 = Ti.UI.createLabel({ width : 'auto', height : 15, top : 32, text : '4.Other Income', color : '#949494', font : { fontSize : 8, fontWeight : 'bold', fontFamily : 'AlteHaasGroteskRegular' }, textAlign : 'center' }); tab4.add(label1);

//......................................whitw line............... var lineview = Ti.UI.createView({ width : 320, height : 1, left : 0, top : 100, backgroundColor : '#696969' }); view.add(lineview);

//.......................................tab view.....................

var tabview = Ti.UI.createView({ top : 101, width : 320, height : 379, left : 0 }); view.add(tabview); //..............................................scroll view....................... var tabwinview = Ti.UI.createScrollView({ contentHeight:'auto', contentWidth:'auto', showHorizontalScrollIndicator:false, showVerticalScrollIndicator:true }) ; tabview.add(tabwinview); //..................................................top view........................ var topview = Ti.UI.createView({ width : 320, height : 70, left : 0, top : 0 }); tabwinview.add(topview);

var label1 = Ti.UI.createLabel({ width : 'auto', height : 15, top : 20, left : 10, text : 'University of Texas at Austin', color : '#949494', font : { fontSize : 13, fontWeight : 'bold', fontFamily : 'HelveticaNeue' }, }); topview.add(label1); var label2 = Ti.UI.createLabel({ width : 'auto', height : 18, top : 36, left : 10, text : 'AVERAGE COST PER SEMESTER', color : '#fff', font : { fontSize : 15, fontWeight : 'bold', fontFamily : 'HelveticaNeue' }, }); topview.add(label2); var label3 = Ti.UI.createLabel({ width : 'auto', height : 18, top : 36, right : 10, text : '$11,000', color : '#8fb046', font : { fontSize : 15, fontWeight : 'bold', fontFamily : 'AlteHaasGroteskRegular' }, }); topview.add(label3); //......................................white line.................... var lineview1 = Ti.UI.createView({ width : 320, height : 1, left : 0, top : 70, backgroundColor : '#696969', }); tabwinview.add(lineview1); //......................................middle view...................... var middleview = Ti.UI.createView({ width : 320, height : 210, left : 0, top : 71 }); tabwinview.add(middleview); var image1 = Ti.UI.createImageView({ image : '1.png', width : 25, height : 30, top : 10, left : 10 }); middleview.add(image1); var label4 = Ti.UI.createLabel({ width : 'auto', height : 17, top : 15, left : 40, text : 'FINANCIAL AID', color : '#fff', font : { fontSize : 15, fontWeight : 'bold', //fontFamily : 'AlteHaasGroteskBold' } }); middleview.add(label4);

var label5 = Ti.UI.createLabel({ width : 'auto', height : 18, top : 50, left : 35, text : 'Scholarship: Dell Scholars', color : '#fff', font : { fontSize : 12, fontWeight : 'bold', //fontFamily : 'AlteHaasGroteskBold' } }); middleview.add(label5); var label6 = Ti.UI.createLabel({ width : 'auto', height : 18, top : 50, right : 10, text : '$6,000', color : '#8fb046', font : { fontSize : 15, fontWeight : 'bold', fontFamily : 'AlteHaasGroteskRegular' } }); middleview.add(label6); //.......................................button view................. var btnview1 = Ti.UI.createView({ width : 300, height : 50, left : 10, top : 90, borderRadius : 6, borderWidth : 1, borderColor : '#000' }); middleview.add(btnview1); var btn1 = Ti.UI.createButton({ height : 48, width : 300, top : 0, left : 0, color : '#fff', title : ' Add More Financial Aid', backgroundImage : 'transparent-box.png', font : { fontSize : 15, fontWeight : 'bold', fontfamily : 'calibiri' }, textAlign : 'left' }); btnview1.add(btn1); btn1.addEventListener('click', function() { alert('hi'); });

var arrowview = Ti.UI.createView({ width : 15, height : 18, right : 10, top : 15, backgroundImage : 'arrow.png' }); btnview1.add(arrowview);

var btnview2 = Ti.UI.createView({ width : 300, height : 50, left : 10, top : 150, borderRadius : 6, borderWidth : 1, borderColor : '#000' }); middleview.add(btnview2); var btn2 = Ti.UI.createButton({ height : 48, width : 300, top : 0, left : 0, color : '#fff', title : ' Institution', backgroundImage : 'transparent-box.png', font : { fontSize : 15, fontWeight : 'bold', fontfamily : 'calibiri' }, textAlign : 'left' }); btnview2.add(btn2); btn2.addEventListener('click', function() { alert('hi'); });

var arrowview = Ti.UI.createView({ width : 15, height : 18, right : 10, top : 15, backgroundImage : 'arrow.png' }); btnview2.add(arrowview); //........................................white line.......................... var lineview2 = Ti.UI.createView({ width : 320, height : 1, left : 0, top :281, backgroundColor : '#696969', }); tabwinview.add(lineview2); //........................................down view............................

var downview = Ti.UI.createView({ width : 320, height : 200, left : 0, top :282 }); tabwinview.add(downview);

var label1 = Ti.UI.createLabel({ width : 'auto', height : 18, top : 30, left : 10, text : 'OUTSTANDING EXPENSES', color : '#fff', font : { fontSize : 15, fontWeight : 'bold', fontFamily : 'HelveticaNeue' }, }); downview.add(label1); var label2 = Ti.UI.createLabel({ width : 'auto', height : 18, top : 30, right : 10, text : '$5,000', color : '#e86f61', font : { fontSize : 15, fontWeight : 'bold', fontFamily : 'AlteHaasGroteskRegular' }, }); downview.add(label2);

var btnview3 = Ti.UI.createView({ width : 280, height : 50, left : 20, top : 70, borderRadius : 6, //borderWidth : 2, //borderColor : '#000' }); downview.add(btnview3); var btn3 = Ti.UI.createButton({ height : 48, width : 280, top : 0, left : 0, color : '#fff', title : 'Next', backgroundImage : 'ProfilePicButton.png', font : { fontSize : 18, fontWeight : 'bold', fontfamily : 'calibiri' }, textAlign : 'center' }); btnview3.add(btn3); btn3.addEventListener('click', function() { alert('hi'); });

win.open();

thanks..........

— asked 8 months ago by ravikant maurya
4 Comments
  • just, wow. Do you think any of the following might be important:

    Link to the questionable image posted online for evaluation?

    Maybe even the ACTUAL ERROR that the emulator is giving you?

    Possibility that you have a bad image?

    The amount of ram you assigned to the VM to begin with and what it is AFTER you change?

    Missing from your question are a number of important pieces of information. I suggest you take a look at the Using Questions and Answers article, specifically the Q&A Question Checklist. The missing information is critical to reproducing problems in a test environment and often indicates other factors that cause the undesirable outcome you are experiencing.

    — commented 8 months ago by Stephen Feather

  • Also, please format your code when you post it. Nobody is going to take the time and try and copy and paste that mess into a new project to even test it. The input text area has a header on it that shows you how to use markdown if you don't know how.

    — commented 8 months ago by Anthony Decena

  • One more thing you should do is clean the application and build it again , and also test application on device.

    — commented 8 months ago by Moiz Chhatriwala

  • Show 1 more comment

Your Answer

Think you can help? Login to answer this question!