Display

理解Android Display的逻辑与真实显示区域
本文详细解释了Android 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) and getMetrics(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 显示屏,或者 外部的显示屏。一个逻辑的显示 的内容 或许会被显示到一个或者更多个物理显示上,根据最近被附加的显示设备以及是否允许反射。

转载于:https://www.cnblogs.com/muyable/p/3777631.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值