AccessibilityService.AttachAccessibilityOverlayToWindow 方法

定義

將輔助功能重疊 android.view.SurfaceControl 附加至指定的視窗。

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

參數

accessibilityWindowId
Int32

視窗識別碼,來自 AccessibilityWindowInfo#getId()

sc
SurfaceControl

包含重疊內容的 SurfaceControl

屬性

備註

將輔助功能重疊 android.view.SurfaceControl 附加至指定的視窗。 當您想要重疊移動和重設大小時,當父視窗移動和重設大小時,應該使用這個方法。

一般而言,輔助功能重迭會是 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.attachAccessibilityOverlayToWindow(int, android.view.SurfaceControl)Java 檔。

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

適用於