Version: Unity 6.7 Alpha (6000.7)
LanguageEnglish
  • C#

AndroidWindowInsets.SetAppearance

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public void SetAppearance(Type type, Appearance appearance);

Parameters

Parameter Description
type The inset types to apply the appearance to. Multiple types can be combined with bitwise OR.
appearance The foreground appearance to set.

Description

Sets the foreground appearance of the specified inset types at runtime.

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.

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); } }