共用方式為


SurfaceView.SetZOrderOnTop(Boolean) Method

Definition

Control whether the surface view's surface is placed on top of its window.

[Android.Runtime.Register("setZOrderOnTop", "(Z)V", "GetSetZOrderOnTop_ZHandler")]
public virtual void SetZOrderOnTop (bool onTop);
[<Android.Runtime.Register("setZOrderOnTop", "(Z)V", "GetSetZOrderOnTop_ZHandler")>]
abstract member SetZOrderOnTop : bool -> unit
override this.SetZOrderOnTop : bool -> unit

Parameters

onTop
Boolean

Whether to show the surface on top of this view's window.

Attributes

Remarks

Control whether the surface view's surface is placed on top of its window. Normally it is placed behind the window, to allow it to (for the most part) appear to composite with the views in the hierarchy. By setting this, you cause it to be placed above the window. This means that none of the contents of the window this SurfaceView is in will be visible on top of its surface.

Note that this must be set before the surface view's containing window is attached to the window manager. If you target Build.VERSION_CODES#R the Z ordering can be changed dynamically if the backing surface is created, otherwise it would be applied at surface construction time.

Calling this overrides any previous call to #setZOrderMediaOverlay.

Java documentation for android.view.SurfaceView.setZOrderOnTop(boolean).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to