文档

Unity Engine

Unity Engine

AndroidWindowInsets.SystemBarsBackground

Controls whether system bars have an opaque or transparent background.
阅读时间1 分钟最后更新于 1 个月前

Definition

public enum AndroidWindowInsets.SystemBarsBackground

Remarks

Use this enum with AndroidWindowInsets.SetSystemBarsBackground and AndroidWindowInsets.GetSystemBarsBackground to control the system bars background at runtime. Set to
Transparent
when insets are overlapping with the application window to allow game content to show through. Requires Android 11 (API 30) and later.

Examples

using UnityEngine;using UnityEngine.Android;public class Controller : MonoBehaviour{ public void Start() { // Make system bars transparent for edge-to-edge rendering. AndroidApplication.currentWindowInsets.SetSystemBarsBackground(AndroidWindowInsets.SystemBarsBackground.Transparent); }}

Fields

Value

Description

OpaqueSystem bars have an opaque background. This is the default.
TransparentSystem bars have a transparent background, allowing game content to show through when insets overlap with the application window.