View.GetGlobalVisibleRect 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
GetGlobalVisibleRect(Rect, Point) |
将 设置为 |
GetGlobalVisibleRect(Rect) |
将 设置为 |
GetGlobalVisibleRect(Rect, Point)
将 设置为 r
视图根视图的坐标空间中此视图的非剪切区域的坐标。
[Android.Runtime.Register("getGlobalVisibleRect", "(Landroid/graphics/Rect;Landroid/graphics/Point;)Z", "GetGetGlobalVisibleRect_Landroid_graphics_Rect_Landroid_graphics_Point_Handler")]
public virtual bool GetGlobalVisibleRect (Android.Graphics.Rect? r, Android.Graphics.Point? globalOffset);
[<Android.Runtime.Register("getGlobalVisibleRect", "(Landroid/graphics/Rect;Landroid/graphics/Point;)Z", "GetGetGlobalVisibleRect_Landroid_graphics_Rect_Landroid_graphics_Point_Handler")>]
abstract member GetGlobalVisibleRect : Android.Graphics.Rect * Android.Graphics.Point -> bool
override this.GetGlobalVisibleRect : Android.Graphics.Rect * Android.Graphics.Point -> bool
参数
- r
- Rect
如果方法返回 true,则包含视图根视图的坐标空间中此视图的可见部分的坐标。 如果方法返回 false,则 r
的内容未定义。
- globalOffset
- Point
如果方法返回 true,则包含此视图的 x 和 y 坐标从视图根视图的左上角的偏移量。 如果方法返回 false,则 globalOffset
的内容未定义。 参数可以为 null, (请参阅 #getGlobalVisibleRect(Rect) getGlobalVisibleRect(Rect)
。
返回
如果至少部分视图在根视图中可见,则为 true;如果视图完全被剪裁或从根视图的可见区域移出,则为 false。
- 属性
注解
将 设置为 r
视图根视图的坐标空间中此视图的非剪切区域的坐标。 设置为 globalOffset
视图的 x 和 y 坐标相对于坐标空间原点的偏移量,该坐标是根视图的左上角,而不考虑屏幕装饰和系统 UI 元素。
若要转换为 r
相对于此视图左上角的坐标, (而不考虑视图旋转) ,请偏移 r
&mdash 的 globalOffset
反值;r.offset(-globalOffset.x, -globalOffset.y)
—这等效于调用 #getLocalVisibleRect(Rect) getLocalVisibleRect(Rect)
。
<b>注意:</b> 不要使用此方法来确定多窗口模式下的窗口大小;请使用 WindowManager#getCurrentWindowMetrics()
。
的 android.view.View.getGlobalVisibleRect(android.graphics.Rect, android.graphics.Point)
Java 文档。
此页面的某些部分是基于 创建和共享的工作进行的修改,并根据 署名许可中所述的条款使用。
适用于
GetGlobalVisibleRect(Rect)
将 设置为 r
视图根视图的坐标空间中此视图的非剪切区域的坐标。
[Android.Runtime.Register("getGlobalVisibleRect", "(Landroid/graphics/Rect;)Z", "")]
public bool GetGlobalVisibleRect (Android.Graphics.Rect? r);
[<Android.Runtime.Register("getGlobalVisibleRect", "(Landroid/graphics/Rect;)Z", "")>]
member this.GetGlobalVisibleRect : Android.Graphics.Rect -> bool
参数
- r
- Rect
如果方法返回 true,则包含视图根视图的坐标空间中此视图的可见部分的坐标。 如果方法返回 false,则 r
的内容未定义。
返回
如果至少部分视图在根视图中可见,则为 true;否则为 false。
- 属性
注解
将 设置为 r
视图根视图的坐标空间中此视图的非剪切区域的坐标。
有关详细信息,请参阅#getGlobalVisibleRect(Rect, Point) getGlobalVisibleRect(Rect, Point)
。
的 android.view.View.getGlobalVisibleRect(android.graphics.Rect)
Java 文档。
此页面的某些部分是基于 创建和共享的工作进行的修改,并根据 署名许可中所述的条款使用。