Reputation: 8375
I am having problem creating layout for different devices. The old qualifier example small, normal and large, xlarge etc..
My layout is very simple. I just want the whole interface keep the same through different devices...
From the android website there is :
xlarge screens are at least 960dp x 720dp large screens are at least 640dp x 480dp normal screens are at least 470dp x 320dp small screens are at least 426dp x 320dp
How should i define with new type of naming to replace small normal large etc..and does that mean i can't use small normal ... as the qualifier for new android os.
Upvotes: 2
Views: 997
Reputation: 4377
For supporting different size screens you can create simply 4-layout folders. layout for normal size, layout-small for small, layout-large for large and layout-xlarge for xlarge screens. And for size of font you can create different values folder like values, values-ldpi, values-mdpi, values-hdpi, values-xhdpi
. Then you can create values folder depending upon height or width and belongs to ldpi
or mdpi
i.e values-w360dp-mdpi
or values-h600dp-mdpi
. Then android automatically picks layout depending upon screen size and values on depending height or width. And you can combine these with new selectors. Like create layout-sw600dp
for 7" tablets.
For more information see this link.
Upvotes: 2