You must take into account that devices of equal size can have different screen densities.
The space occupied by an image, relative to the screen dimensions, is different in each density. The lower the density the greater the space occupied.
For the occupied space to be equal it is necessary to provide images sized for each one of them.
You should create in the folder \res
new drawable folders, one for each density, in the form drawable-xxx
, where xxxx
is:
- ldpi
- mdpi
- hdpi
- xhdpi
- xxhdpi
The image sizes, to be included in each of them, are calculated in relation to the image in the mdpi folder.
Use an image editor that allows you to resize them, Photoshop for example.
The factors to be used are:
- ldpi => 0.75
- mdpi => 1
- hdpi => 1.5
- xhdpi => 2
- xxhdpi => 3
With the dimensions of the MDPI the other dimensions are calculated by multiplying this dimension by the respective factor:
dimensão-hdpi = dimensão-mdpi * 1.5
When the starting dimension does not correspond to mdpi, divide it by the factor corresponding to that density and multiply by the density factor for which you want to calculate the dimensions.
For example, if you have an image that "looks good" in xhdpi
, dimensions for other densities are calculated as such:
dimensão-xxx = (dimensão-xhdpi / 2) * factor-xxx
You have to take into account that devices of equal size can have different densities. In addition to different layouts for each dimension has to have images sized for each density.
– ramaral
@Exact extension, I entered the folders
drawable
with the various types of density however I do not know which is the size that each image has in each folder. I have a picture of 60x70 +- and looks good on devicesxhdpi
but when I pass tohdpi
is bad enough– Hugo