[英]What is the resolution of default layout in Android?
I am just using simple default layout and not adding any of these layout versions; 我只是使用简单的默认布局,而不添加任何这些布局版本;
l-dpi-Layout
, m-dpi-layout
etc.. then what exactly the resolution of my default layout is ? l-dpi-Layout
, m-dpi-layout
等。 那么我的默认布局的分辨率到底是多少?
Let say i add an image and define its width-height
as 20dp X 20dp
. 假设我添加了一个图像并将其
width-height
定义为20dp X 20dp
。 This image is looking perfect in layout Preview
screen, but would it look same in 1440X2560
screen or 1920X1080
screen. 该图像在“
layout Preview
屏幕中看起来很完美,但是在1440X2560
屏幕或1920X1080
屏幕中看起来还是一样。
My concerns are: 我担心的是:
20 dpi
i am defining fits best for 1080X1920
resolution and 27dpi
fits best 1440X2560 screen
, when i am writing 20dpi
in my default layout which perfectly fits in layout preview
screen 20 dpi
我定义最适合为1080X1920
的分辨率和27dpi
最适合1440X2560 screen
,当我写20dpi
,其中完全符合我的默认布局layout preview
屏 The system assumes a target device with a density of 160dpi. 系统假定目标设备的密度为160dpi。 When you define the size of yout image with dp unit, Android adapts the size according with the resolution of the device.
当您使用dp单位定义yout图片的尺寸时,Android会根据设备的分辨率调整尺寸。 For example, if you put an image of 100dp x 100dp in a 160dpi device it will take 100 x100 pixels, but in a device with a 640dpi screen it will take 400 x 400 pixel
例如,如果将100dp x 100dp的图像放置在160dpi的设备中,它将占用100 x100像素,但是在具有640dpi屏幕的设备中,它将花费400 x 400像素
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.