Skip to content Skip to sidebar Skip to footer

How Do I Create Different Layouts For 4" And 10" Displays At Same Resolution?

According to this Android document, Supporting Multiple Screens, it seems that an image displayed by a 4' screen at 320ppi will also be utilized by a 10' at 300ppi, however, the la

Solution 1:

it seems that an image displayed by a 4" screen at 320ppi will also be utilized by a 10" at 300ppi

By default, yes, insofar as both devices will pull from the same -xhdpi resource set. They will both render at about the same physical size.

the layout displayed by the same 4" display will be shared with a 7" display at 216ppi.

By default, no, insofar as 4" displays are -normal and 7" displays are -large, using the old set of size buckets, and so if you have different layouts in those directories, each device will use the layout appropriate for that device.

So how does one practically make specific layouts, including artwork for a specific type of device?

For layouts, either use the legacy size buckets (e.g., -normal, -large) or create your own (e.g., -sw600dp).

For drawables, start by putting them in the density-specific buckets (e.g., -mdpi, -hdpi, -xhdpi). If you determine that you have an image that logically is the same, but you do not want to use the same physical size image on the same density devices ("a 4" screen at 320ppi will also be utilized by a 10" at 300ppi"), you can blend in the size resource set qualifiers as well (e.g., res/drawable-large-hdpi/ would be used on -large devices with -hdpi density).

Solution 2:

You would put the resource xml files in the proper folder such as layout-xlarge-xhdpi or layout-normal-hdpi or layout-large-hdpi, ect.

Post a Comment for "How Do I Create Different Layouts For 4" And 10" Displays At Same Resolution?"