简体   繁体   English

如何在使用unity创建的android应用中显示导航栏

[英]How to show navigation bar in my android app created with unity

I'm creating android app with Unity. 我正在使用Unity创建android应用。 Although I deleted this statement 虽然我删除了这句话

AndroidManifest.xml AndroidManifest.xml中

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

It's still not showing navigation bar in my app. 它仍然没有在我的应用程序中显示导航栏。 Can you help me someone? 你能帮我一个人吗?

Folder Path is MyUnityProject/Assets/Plugins/Android/AndroidManifest.xml and AndroidManifest.xml 文件夹路径为MyUnityProject / Assets / Plugins / Android / AndroidManifest.xmlAndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest
    xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.unity3d.player"
    android:installLocation="preferExternal"
    android:versionCode="1"
    android:versionName="1.0">
    <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="22" />
    <uses-feature android:name="android.hardware.camera" />
    <supports-screens
        android:smallScreens="true"
        android:normalScreens="true"
        android:largeScreens="true"
        android:xlargeScreens="true"
        android:anyDensity="true"/>
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>

    <application
        android:icon="@drawable/app_icon"
        android:label="@string/app_name"
        >
        <activity android:name="com.unity3d.player.UnityPlayerNativeActivity"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            <meta-data android:name="unityplayer.UnityActivity" android:value="true" />
            <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="false" />
        </activity>
        <activity android:name="com.unity3d.player.VideoPlayer"
                  android:label="@string/app_name"
                  android:screenOrientation="portrait"
                  android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">

        </activity>
        <!--
            To support devices using the TI S3D library for stereo mode we must
            add the following library.
            Devices that require this are: ODG X6
        -->
        <uses-library android:name="com.ti.s3d" android:required="false" />
        <!--
            To support the ODG R7 in stereo mode we must add the following library.
        -->
        <uses-library android:name="com.osterhoutgroup.api.ext" android:required="false" />
    </application>
</manifest>

<!-- android:installLocation="preferExternal" -->

This is achieved by turning off full screen mode. 这可以通过关闭全屏模式来实现。

#if UNITY_ANDROID
    Screen.fullScreen = false;
#endif

https://docs.unity3d.com/ScriptReference/Screen-fullScreen.html https://docs.unity3d.com/ScriptReference/Screen-fullScreen.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM