AccessibilityService.AttachAccessibilityOverlayToDisplay 方法

定義

android.view.SurfaceControl將包含輔助功能重疊的 附加至指定的顯示器。

[Android.Runtime.Register("attachAccessibilityOverlayToDisplay", "(ILandroid/view/SurfaceControl;)V", "GetAttachAccessibilityOverlayToDisplay_ILandroid_view_SurfaceControl_Handler", ApiSince=34)]
public virtual void AttachAccessibilityOverlayToDisplay (int displayId, Android.Views.SurfaceControl sc);
[<Android.Runtime.Register("attachAccessibilityOverlayToDisplay", "(ILandroid/view/SurfaceControl;)V", "GetAttachAccessibilityOverlayToDisplay_ILandroid_view_SurfaceControl_Handler", ApiSince=34)>]
abstract member AttachAccessibilityOverlayToDisplay : int * Android.Views.SurfaceControl -> unit
override this.AttachAccessibilityOverlayToDisplay : int * Android.Views.SurfaceControl -> unit

參數

displayId
Int32

應該附加 SurfaceControl 的顯示。

sc
SurfaceControl

包含重疊內容的 SurfaceControl

屬性

備註

android.view.SurfaceControl將包含輔助功能重疊的 附加至指定的顯示器。 這種類型的重疊應該用於不需要追蹤目前使用中應用程式中檢視的位置和大小的內容,例如服務組態或一般服務 UI。

一般而言,輔助功能重迭會是 android.view.View。 若要將檢視內嵌至 android.view.SurfaceControl,請使用 android.view.SurfaceControlViewHost#setView建立 android.view.SurfaceControlViewHost 並附加檢視。 然後藉由呼叫 viewHost.getSurfacePackage().getSurfaceControl()取得 SurfaceControl。

若要移除此重疊並釋放相關聯的資源,請使用 new SurfaceControl.Transaction().reparent(sc, null).apply();

如果指定的重迭已經附加至指定的顯示,這個方法就不會執行任何動作。 如果指定的重迭已經附加至先前的顯示,則此函式會將重迭傳送至新的顯示器。 服務可以附加多個重疊。 使用 new SurfaceControl.Transaction().setLayer(sc, layer).apply();。 以協調螢幕上重疊的順序。

android.accessibilityservice.AccessibilityService.attachAccessibilityOverlayToDisplay(int, android.view.SurfaceControl)Java 檔。

此頁面的部分是根據 Android 開放原始碼專案所建立和共用的工作進行修改,並根據 Creative Commons 2.5 屬性授權中所述的詞彙使用。

適用於