Display.GetCurrentSizeRange(Point, Point) 方法

定义

返回应用程序在正常操作下可能遇到的显示大小范围,只要屏幕大小没有物理变化。

[Android.Runtime.Register("getCurrentSizeRange", "(Landroid/graphics/Point;Landroid/graphics/Point;)V", "GetGetCurrentSizeRange_Landroid_graphics_Point_Landroid_graphics_Point_Handler")]
public virtual void GetCurrentSizeRange (Android.Graphics.Point? outSmallestSize, Android.Graphics.Point? outLargestSize);
[<Android.Runtime.Register("getCurrentSizeRange", "(Landroid/graphics/Point;Landroid/graphics/Point;)V", "GetGetCurrentSizeRange_Landroid_graphics_Point_Landroid_graphics_Point_Handler")>]
abstract member GetCurrentSizeRange : Android.Graphics.Point * Android.Graphics.Point -> unit
override this.GetCurrentSizeRange : Android.Graphics.Point * Android.Graphics.Point -> unit

参数

outSmallestSize
Point

用应用程序将遇到的最小宽度和高度填充,以像素为单位(而不是 dp 单位)。 此处的 x (宽度) 维度直接对应 android.content.res.Configuration#smallestScreenWidthDp Configuration.smallestScreenWidthDp,此处的值以原始屏幕像素而不是 dp 单位为单位。 当然,如果显示软键盘,应用程序可能仍会获得较小的空间。

outLargestSize
Point

以像素为单位(而不是 dp 单位)填充应用程序将遇到的最大宽度和高度。 当然,如果屏幕修饰(如状态栏)正在隐藏,则应用程序可能仍会获得比这更大的空间。

属性

注解

返回应用程序在正常操作下可能遇到的显示大小范围,只要屏幕大小没有物理变化。 这基本上是你将看到的方向变化的大小,考虑到每个旋转中存在的任何屏幕修饰。 例如,状态栏始终位于屏幕顶部,因此它将减少横向和纵向的高度,此处返回的最小高度将是两者中较小的高度。

这适用于应用程序了解在设备轮换时遇到的大小范围,以便通过旋转提供稳定的 UI。 此处的大小考虑到了减少应用程序实际可用的大小的所有标准系统修饰:状态栏、导航栏、系统栏等。它不会<></em> 考虑更多的暂时性元素,如 IME 软键盘。

适用于 . 的 android.view.Display.getCurrentSizeRange(android.graphics.Point, android.graphics.Point)Java 文档

本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。

适用于