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

AndroidWindowInsets.SetOverlapping

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

Parameters

Parameter Description
type The complete set of inset types that should overlap with the application window. Replaces the entire overlapping mask.

Description

Sets which insets are allowed to overlap with the application window.

When an inset is overlapping, the application window extends behind it instead of being resized to avoid it. Screen.safeArea excludes areas covered by overlapping insets. The parameter replaces the entire overlapping mask.

Note: Only supported on Android 11 (API 30) or later.

using UnityEngine;
using UnityEngine.Android;

public class Controller : MonoBehaviour { public void Start() { AndroidApplication.currentWindowInsets.SetOverlapping(AndroidWindowInsets.Type.StatusBars | AndroidWindowInsets.Type.NavigationBars); } }