Admite pantallas con la misma resolución pero con diferentes DPI

I need my app to support 480x800 normal hdpi y 480x800 large mdpi screens. The UI for them is lo mismo. The matter is using dp in this case is a wrong way because on hdpi device everything becomes larger. But I need just scalable UI.
Is it possible I provide that by using single version of layout files?

preguntado el 10 de marzo de 12 a las 13:03

1 Respuestas

use 2 set of images and put in the 1.x mdpi and other in 1.5x hdpi

here 1 and 1.5 is size ratio

only one layout xml file is enough.

EDIT: //while design keep in mind with 1x that is mdpi

//for example if you set 5dp for you mdpi resolution

it will automatically change for hdpi as

5*240/160=7.5 px  //for hdpi
5*320/160=10 px   //for xhdpi

respondido 10 mar '12, 14:03

ok, if I use 10dp padding it is larger on hdpi... so, layout is not scalable - Serguéi Metlov

thanks but I need something like percentage. for example set width of element to 5% of screen width or like this.. to make the app looks equal on all the screens without writing many separate layout files - Serguéi Metlov

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.