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
相對於此檢視左上角的座標, (而不考慮檢視旋轉) ,請依&mdash 的globalOffset
反值位移r
;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 檔。
此頁面的部分是根據 原始碼專案所建立和共用的工作進行修改,並根據 中所述的詞彙使用。