Quantcast
Channel: Appcelerator Developer Center Q&A Tag Feed (sizes)
Viewing all articles
Browse latest Browse all 9

managing differents sizes on android

$
0
0

Hi,

I have this code :

var topContainer = Ti.UI.createView({
    top : 44,
    width: '100%',
    height : 46
});
 
var toutTab = Ti.UI.createView({
    backgroundImage : '/images/tabTousOver.png',
    width: 65,
    left: 0,
    height : 46
});
 
var offreTab = Ti.UI.createView({
    backgroundImage : '/images/tabOffres.png',
    width: 100,
    left: 65,
    height : 46
});
 
var searchTab = Ti.UI.createView({
    backgroundImage : '/images/tabRecherche.png',
    width: 85,
    left: 165,
    height : 46
});
 
var actuTab = Ti.UI.createView({
    backgroundImage : '/images/tabActus.png',
    width: 70,
    left: 250,
    height : 46
});
 
topContainer.add(toutTab);
topContainer.add(offreTab);
topContainer.add(searchTab);
topContainer.add(actuTab);
The value are in dp not in px. As you see, the total of width is 320 in medium density.

The advice i got is that i should use dp instead of percents and you image in the good folders.

but i have problem with xhdpi. it is said the xhdpi = mdpi * 2. so 320 of width for medium is 640 for hdpi.

i have white space at the right so i replaced for xhpi folder that the total width is 720 but i still have blanc space at the right.

any help. thanks


Viewing all articles
Browse latest Browse all 9

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>