Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
451 views
in Technique[技术] by (71.8m points)

android - Why Nexus 6 density is 560 dpi?

How to prepare resources for Nexus 6? If I put images to xxxhdpi they will scale down and lose quality. I put images to xxhdpi they will scale up and lose quality. Why developers decided setup value 560dpi for density, if real density 493ppi is more closer to xxhdpi ~480dpi?

The Nexus 6 boasts an impressive 5.96” Quad HD screen display at a resolution of 2560 x 1440 (493 ppi). This translates to ~ 730 x 410 dp (density independent pixels).

Nexus 6 has a quantized density of 560 dpi, which falls in between the xxhdpi and xxxhdpi primary density buckets.

For the Nexus 6, the platform will scale down xxxhdpi assets, but if those aren’t available, then it will scale up xxhdpi assets.

xxhdpi ~480dpi
xxxhdpi ~640dpi
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

In the case of the Nexus 6, the manufacturer chose a quantized density of 560 (adb shell getprop ro.sf.lcd_density), even though the physical density is about 493 (getResources().getDisplayMetrics().toString()). Understanding why they might do this requires understanding the meaning of the quantized density and how it affects image resource rendering, which is explained here.

In short, the quantized density of 560 means that the scale factor employed to load/render images will be 3.5. In the words of D. Hackborn, 'The density ... is an abstract density bucket the device manufacturer has decided makes sense for their UI to run in. This is what is used to evaluate things like "dp" units and select and scale bitmaps from resources.'


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...