I’m testing one of my layouts using the different devices defined in the graphical layout editor in Eclipse. Due to some of the devices’ varying resolutions I had to define different dimens.xml files to define specific font sizes so the design would look correct.
I have a dimens.xml file in each of the following resource folders:
- values
- values-sw1280dp
- values-sw640dp
- values-sw800dp
- values-sw800dp-large
For whatever reason the device 7in WSVGA (Tablet) uses the dimens.xml in the values folder. But according to the device configuration the resolution for this device is 1024 x 600, so shouldn’t it be using the dimens.xml defined in values-sw800dp-large?
Anyone have any idea?
It won’t use
values-sw800dp-largebecause that qualifier means that the smallest dimension must be at least 800dp. Also note that these are dp values, not pixels. So if the device is hdpi, 800dp is 1200 pixels.If you’re doing this in an emulator, there is a weird interaction with device display density and scaling of the emulator display. So, for instance, if your device is supposed to be hdpi, it may actually be treated as an mdpi display unless you specify a scaling.