size of image on iOS

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

i run my app on iphone simulator with IOS SDK 5.1 i think that resolution is 640 * 960.

here is my code :

var menu = Ti.UI.createView({
        top: 0,
        height: 132,
        backgroundImage: 'images/fond_menu.png',
        layout: 'horizontal'
    });
 
    var alaune = Ti.UI.createImageView({image: 'images/alaune.png', left: 0, top: 0});
    var actu = Ti.UI.createImageView({image: 'images/actu.png'});
    var classement = Ti.UI.createImageView({image: 'images/classement.png'});
 
    menu.add(alaune); menu.add(actu); menu.add(classement);
the width of alaune = 191, actu = 190, classement = 189 so the total witdh is : 570.

the problem is that all pictures are not horizontally placed and exceed the width.

i find that it is not normal. have an explanation ?

thanks

1 Answer

The iphone, no matter if is retina or not has a resolution of 320x480 (fullscreen). The difference is how many dpi a pixel has.

Make your calculation against the 320x480 resolution, and for retina use images twice the size.

Makes sense?

Your Answer

Think you can help? Login to answer this question!