简体   繁体   English

调整图像大小以使所有设备看起来相同

[英]Resizing an image to look the same across all devices

I read the http://developer.android.com/guide/practices/screens_support.html and I understood only a few things. 我阅读了http://developer.android.com/guide/practices/screens_support.html ,我只了解了一些内容。 So, I have an ImageView with android:src = "@drawable/logo" . 所以,我有一个带有android:src = "@drawable/logo"的ImageView android:src = "@drawable/logo" The logo.png is placed inside my res/drawable-mdpi and its image-size is 100x100 pixels. logo.png放在我的res/drawable-mdpi ,其image-size为100x100像素。

In what dimensions should I save the image in the following folders, so it can look the same in relation to the screen size across all devices?: 我应该在以下文件夹中将图像保存在哪个维度,因此它在所有设备的屏幕尺寸方面看起来都相同?:

- res/drawable-ldpi - res/drawable-hdpi - res/drawable-xhdpi - res/drawable-xxhdpi - res/drawable-ldpi - res/drawable-hdpi - res/drawable-xhdpi - res/drawable-xxhdpi

Simple things. 简单的事情。 Is 75x75, 150x150, 200x200, 300x300, the correct answer? 是75x75,150x150,200x200,300x300,正确答案? Should I bother changing its pixels/inch in my image editor as well? 我也应该在图像编辑器中更改像素/英寸吗?

The magic numbers are 3:4:6:8:12. 神奇的数字是3:4:6:8:12。 Those are the proportions you should use for l:m:h:xh:xxh -dpi image resources. 这些是您应该用于l:m:h:xh:xxh -dpi图像资源的比例。 For example, your launcher icon should be 例如,您的启动器图标应为

  • 36x36 for ldpi 36x36为ldpi
  • 48x48 for mdpi mxpi为48x48
  • 72x72 for hdpi 72x72为hdpi
  • 96x96 for xhdpi xxpi为96x96
  • 144x144 for xxhdpi 144x144 for xxhdpi

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

相关问题 调整图像大小以使其在所有设备上看起来都一样而不会损失质量 - Resizing images to look the same across all devises without losing quality 图标在所有设备上看起来都不一样 - Icons don`t look the same on all devices Android-如何使用户界面在设备上看起来相同? - Android - How to make UI look same across devices? Android:可以在布局上使用DP并使其在所有设备上看起来一样吗? - Android: Possible to use DP on a layout and make it look the same across devices? 如何保持图像XY比例不变,并使其在所有设备上看起来都一样? - How to keep image XY scale ratio constant and make it look the same on all devices? 如何在所有设备上看起来相同的边距处放置视图? - How to position the view with margin that will look same for all devices? 如何让我的应用在所有设备中看起来都一样? - How to make my app look the same in all devices? 如何使应用程序在所有设备上看起来都一样 (android) - How to make a app scale the look the same on all devices (android) 跨所有Android设备的主题相同 - Same Theme across all android-powered devices 在所有设备上具有相同的布局。 怎么样? - Having the extra same layout across all devices. How?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM