简体   繁体   English

Android 420 dpi和560dpi

[英]Android 420 dpi and 560dpi

Is there a way to create a drawable folder and a values folder to 420 dpi and 560 dpi devices? 有没有一种方法可以为420 dpi和560 dpi设备创建可绘制文件夹和值文件夹? One for the 420 dpi and one for 560 dpi. 一种用于420 dpi,另一种用于560 dpi。

420dpi: Samsung Galaxy S5, S4, LG G5, ... 420dpi:三星Galaxy S5,S4,LG G5,...

560dpi: Nexus 6, Samsung S6, S7, ... 560dpi:Nexus 6,三星S6,S7,...

Because in those type of devices my app not looks well. 因为在这些类型的设备中,我的应用程序看起来不太好。 Images in drawable-xxhdpi are smaller in a device with 420 dpi. 在420 dpi的设备中,drawable-xxhdpi的图像较小。 Because multiplies the width of the image x 2,625 (density). 因为将图像的宽度乘以2,625(浓度)。 I need bigger images or multiply images x 3. 我需要更大的图像或将图像乘以3。

The solution that I've found is to create a drawable-420dpi and a drawable-560dpi folder and copy xxhdpi and xxxhdpi resources respectively. 我发现的解决方案是创建一个drawable-420dpi和一个drawable-560dpi文件夹,并分别复制xxhdpi和xxxhdpi资源。

I'm not sure that this is the best solution but It works on PIXEL XL, Nexus 5X, 6 and 6p simulators. 我不确定这是否是最好的解决方案,但它可以在PIXEL XL,Nexus 5X,6和6p模拟器上运行。

This is very frustrating for developers and designers too. 对于开发人员和设计师来说,这也非常令人沮丧。

如果您使用的是Android Studio,则可以在与mipmap-hdpi,mipmap-mdpi,mipmap-xhdpi等文件夹相同的文件夹中轻松创建文件夹宽度名称:mipmap-420dpi和mipmap-560dpi...。您可以看到此图片

您可以使用DisplayMetrics获得ppi,获得ppi之后,您可以使用IF条件并设置需要设置的可绘制对象。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM