2

歌地图上的预测参考说:

屏幕位置是相对于地图左上角(不一定是整个屏幕)的屏幕像素(不是显示像素)。

屏幕像素和显示像素有什么区别?官方文档也没有回答这个问题。

4

2 回答 2

3
  • 即使屏幕具有不同的像素密度(像素密度由屏幕中每个像素的大小决定),显示像素“看起来都一样”。
  • 屏幕像素取决于屏幕上像素的大小。

例如,Retina Display 小工具的像素非常小,因此 " 1sp" (sp = 屏幕像素) 的宽度会非常小。“ ” 的宽度1dp在 Retina Display 小工具和大像素屏幕中看起来是一样的。

于 2013-06-26T22:41:26.727 回答
1

The main difference between sp and dp is that the size of each dp is scaled depending on the pixel density of the device, while sp is also scaled but takes into account of the user's font size. You would use the unit dp to make sure your layouts look the same across devices with different pixel densities. Screen pixels are mostly used just for font sizes.

Check here for more information about the different types of units.

于 2013-06-26T22:50:43.817 回答