Salsero69
Salsero69

Reputation: 2240

How to determine which resource file is being used and why?

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:

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?

Upvotes: 0

Views: 1006

Answers (1)

Ted Hopp
Ted Hopp

Reputation: 234857

It won't use values-sw800dp-large because 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.

Upvotes: 1

Related Questions