文档

Unity Engine

Download Unity

Unity Engine

SetAppearance(Type, Appearance)

Sets the foreground appearance of the specified inset types at runtime.
阅读时间1 分钟最后更新于 1 个月前

Definition

public void SetAppearance(AndroidWindowInsets.Type type, AndroidWindowInsets.Appearance appearance)

Parameters

type

The inset types to apply the appearance to. Multiple types can be combined with bitwise OR.

appearance

The foreground appearance to set.

Remarks

Controls whether system bar icons appear light or dark for individual inset types. Multiple inset types can be combined to set the same appearance for all of them.
Note: Only supported on Android 11 (API 30) or later. For AndroidWindowInsets.Type.CaptionBar, appearance requires Android 15 (API 35) or later. On Android 11 to 14 (API 30 to 34) setting it has no effect and AndroidWindowInsets.GetAppearance reports
Light
.

Examples

using UnityEngine;using UnityEngine.Android;public class Controller : MonoBehaviour{ public void Start() { var insets = AndroidApplication.currentWindowInsets; insets.SetAppearance(AndroidWindowInsets.Type.StatusBars, AndroidWindowInsets.Appearance.Light); // Set both bars at once. insets.SetAppearance(AndroidWindowInsets.Type.StatusBars | AndroidWindowInsets.Type.NavigationBars, AndroidWindowInsets.Appearance.Dark); }}