Hi,
Can you please tell me how can I specify dimension of layout for different density of screen? i.e. the layout are the same across different densities, but some dimension are different. how can I do that?
Thank you.
Hi,
Can you please tell me how can I specify dimension of layout for different density of screen? i.e. the layout are the same across different densities, but some dimension are different. how can I do that?
Thank you.
You can use different units to have the dimensions adapt to the screen.
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters).
you define you layout and put it under
res/layout-Qualifier/my_layout.xml
where Qualifier could be one or more of the following
size : small, normal, large
density: ldpi,mdpi, hdpi.
For example layout for large screen with high density would be res/layout-hdpi-large/my_layout.xml
For full list of attributes see answer above