Version: Unity 7.0 Alpha (7000.0)
LanguageEnglish
  • C#

AndroidWindowInsets.GetAppearance

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 Appearance GetAppearance(Type type);

Parameters

Parameter Description
type A single inset type to query. Passing combined flags throws an ArgumentException.

Returns

Appearance The current appearance, either Light or Dark.

Description

Returns the current foreground appearance of the specified inset type.

Returns whether the specified inset type currently has light or dark icons. Only a single inset type may be passed; passing combined flags throws an ArgumentException. Returns Light for AndroidWindowInsets.Type.None.

Note: Only supported on Android 11 (API 30) or later. Reports Light for AndroidWindowInsets.Type.CaptionBar on Android 11 to 14 (API 30 to 34), because caption bar appearance requires Android 15 (API 35) or later.

using UnityEngine;
using UnityEngine.Android;

public class Controller : MonoBehaviour { public void Start() { var appearance = AndroidApplication.currentWindowInsets.GetAppearance(AndroidWindowInsets.Type.StatusBars); Debug.Log("Status bar appearance: " + appearance); } }