Display
public final class
Display
extends Object
java.lang.Object | |
↳ | android.view.Display |
Class Overview 类的概览
Provides information about the size and density of a logical display. 提供一个逻辑上显示的display的大小和密度信息。
The display area is described in two different ways. 这个display 区域用下面两中方式来描述:
- The application display area specifies the part of the display that may contain an application window, excluding the system decorations. The application display area may be smaller than the real display area because the system subtracts the space needed for decor elements such as the status bar. Use the following methods to query the application display area:
getSize(Point)
,getRectSize(Rect)
andgetMetrics(DisplayMetrics)
.
- The real display area specifies the part of the display that contains content including the system decorations. Even so, the real display area may be smaller than the physical size of the display if the window manager is emulating a smaller display using (adb shell am display-size). Use the following methods to query the real display area:
getRealSize(Point)
,getRealMetrics(DisplayMetrics)
.
这个应用显示区域指定显示的部分 或许包含一个应用窗口,不包括一个系统的修饰。这个应用显示区域或许比真实的显示区域要小,因为系统缩减了装饰元素所需的空间,例如status bar。用下列的方法去查询应用的显示区域:getSize(Point),getRectSize(Rect)和getMetrics(DisplayMetrics)。
真实的显示区域指定了显示的部分,包含内容和系统的修饰。尽管如此,这个真实的显示区域或许比物理的显示尺寸要小,如果窗口管理器在模拟一个更小的显示应用(adb shell am display-size)。使用下面的方法去查询真实的显示区域:getRealSize(Point),getRealMetrics(DisplayMetrics).
A logical display does not necessarily represent a particular physical display device such as the built-in screen or an external monitor. The contents of a logical display may be presented on one or more physical displays according to the devices that are currently attached and whether mirroring has been enabled.
一个逻辑显示并不必须表示一个特殊的物理显示设备,例如 built-in 显示屏,或者 外部的显示屏。一个逻辑的显示 的内容 或许会被显示到一个或者更多个物理显示上,根据最近被附加的显示设备以及是否允许反射。