I am trying to design different layouts for different screen sizes. I have created layout files for sw240dp, and I am now trying to design layouts for sw480dp. My problem involves the list of devices in the layout editor. I am trying to select a 3.7 inch device to design on, but the software keeps jumping over to the sw240dp layout file every time I select the 3.7 inch device for sw480dp. I don't understand what I'm doing wrong here. Is there something wrong with my eclipse software, or am I doing something wrong?

有帮助吗?

解决方案

What resolution and density are you selecting for the emulated device? The DP is determined by the density and resolution. So for 480 DP, here is the mapping from density to required pixel resolution:

MDPI (160) : 480px
HDPI (240) : 720px
XHDPI(320) : 960px

So if you're picking a 3.7" 480x800 device at HDPI, that's not going to fall into the sw480dp bucket. You'd need to create it as an MDPI device (i.e. density of 160).

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top