1
\$\begingroup\$

When I open my unity app it doesn't go full-screen until I change it in the settings, isn't there a way to do that... it actually isn't a scaling problem or an aspect ratio.... Because you can see how in the phone settings it is turned offenter image description hereenter image description hereenter image description here Thanks in advance enter image description here

\$\endgroup\$

1 Answer 1

0
\$\begingroup\$

On Android platform you can use manifest merge trick. According to the question you need fullscreen app, so i can suggest to create your own .aar (android plugin, like jar but can contain resources such as styles) and add your own style. Then you can use it in your unity android manifest.

  1. After created an empty android plugin according to the documentation, we need also create new style in styles.xml.

    <style name="Theme.AppCompat.Light.NoActionBar.FullScreen" parent="@style/Theme.AppCompat.Light.NoActionBar">
    <item name="android:windowNoTitle">true</item>
    <item name="android:windowActionBar">false</item>
    <item name="android:windowFullscreen">true</item>
    <item name="android:windowContentOverlay">@null</item>
    </style>
    
    1. After that you need to mention this theme in your manifest file in Plugins/Android directory of your unity project

      android:theme="@android:style/Theme.AppCompat.Light.NoActionBar.FullScreen"

or you can use more simplier variant that don't need to resolve dependencies from resolver of app compat library (see)

android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"

So in conclusion you need to know android platform and how to create android plugins and connect it in unity project

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .