简体   繁体   English

如何解决不同屏幕尺寸的相同dpi问题

[英]how to solve same dpi problem with different screen size

my phone is galaxy s9 that is 5.8 inch and xxhdpi.我的手机是 5.8 英寸和 xxhdpi 的 Galaxy s9。 And my virtual test phone is nexus 5 that is xxhdpi but the screen size is 4.95 inch.我的虚拟测试手机是 xxhdpi,但屏幕尺寸为 4.95 英寸的 nexus 5。 The imageview from the Galaxy S9 appears to be cut off from the Nexus 5. Layout-xxhdpi applies to the same device, with some looking right and some looking fired. Galaxy S9 的 imageview 似乎与 Nexus 5 截断。Layout-xxhdpi 适用于同一设备,有些看起来正确,有些看起来被解雇了。 How can I solve this?我该如何解决这个问题?

I would like to recommend you use Vector drawables .我想推荐你使用Vector drawables

The major advantage of using a vector drawable is image scalability.使用矢量可绘制对象的主要优点是图像可伸缩性。 It can be scaled without loss of display quality, which means the same file is resized for different screen densities without loss of image quality.它可以在不损失显示质量的情况下进行缩放,这意味着针对不同的屏幕密度调整同一文件的大小而不会损失图像质量。

Vector drawables allow you to replace multiple png/jpg/jpeg assets with a single vector graphic, defined in XML.矢量绘图允许您用 XML 中定义的单个矢量图形替换多个png/jpg/jpeg资源。

FYI- For responsive Textsize issue, You should use SDP仅供参考-对于响应式 Textsize 问题,您应该使用SDP

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

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