Help - How to handle safe area or notch for mobile devices?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By mr-ro95

How can I adjust my game to scale well on devices with different notch sizes and other safe areas?

I don’t want to set a specific top and bottom margin just to avoid the notch, because I’m planning to build on tablets and iPad as well. So I need to maximize the whole screen, and just adjust the UI to the safe area of the device if it has one.

I hope someone could help.

Thank you so much :slight_smile:

:bust_in_silhouette: Reply From: qq715152910

I also encountered the same problem, multiple attempts to modify the '‘AndroidManifest.xml’ but none worked …
No matter how to adapt and adjust the zoom level,
Safe area always shows nothing…

enter link description here

enter image description here

:bust_in_silhouette: Reply From: Star Frog

I would also be interested in that. I have the same problem.

:bust_in_silhouette: Reply From: byjtew93

Into android/build/res/values/themes.xml, replace the styles by this code:

<style name="GodotAppMainTheme" parent="@android:style/Theme.Black.NoTitleBar.Fullscreen">
	<item name="android:windowLayoutInDisplayCutoutMode">never</item>
	<item name="android:windowTranslucentStatus">true</item>
	<item name="android:windowTranslucentNavigation">true</item>
</style>

<style name="GodotAppSplashTheme" parent="@style/GodotAppMainTheme">
	<item name="android:windowBackground">@drawable/splash_drawable</item>
	<item name="android:windowLayoutInDisplayCutoutMode">never</item>
	<item name="android:windowTranslucentStatus">true</item>
	<item name="android:windowTranslucentNavigation">true</item>
</style>