tags:

views:

68

answers:

2

dear friends,

i have created application using layout font sizes in "pixels" font and other layout looks fine on HTC hero and Motorola Droid but in nexus one which is bigger resolution phone every thing is messed up.

for example ,

i have used font 18px which is bigger size in HTC Hero and Motorola but in Nexus one it is looking very small.

same is the case with image height and width

a banner looks fine on both phones but in nexus one very small. actually we dont have height and width in percentage thats why i am not able to solve this problem. layout_width="fill_parent" also not helping..

kindly help me out what should i do to make application look same in all the phones with different resolutions.

+1  A: 

Pixels are the wrong unit. You want to use either real world measurements or "scaled pixels". The Android SDK recommends using scaled pixels (sp) when working with fonts as those are scaled based on any font settings. Other UI elements should be laid out using "density pixels" (dp) which are pixels scaled for higher density screens.

Yann Ramin
+1  A: 

I'd start using sp and dips instead of px. http://stackoverflow.com/questions/2025282/difference-of-px-dp-dip-and-sp-in-android/2025541#2025541 Then i would rethink UI and change it so you don't need to specify layouts in fixed dimensions.

Alex Volovoy