Unity 全面屏适配

如果安卓接入还不会的请看这里

https://blog.csdn.net/SnoopyNa2Co3/article/details/85060577

下面是谷歌开发者社区介绍

https://chinagdg.org/2017/04/%E6%9B%B4%E6%96%B0%E6%82%A8%E7%9A%84%E5%BA%94%E7%94%A8%E4%BB%A5%E5%85%85%E5%88%86%E5%88%A9%E7%94%A8%E6%96%B0%E6%AC%BE-android-%E6%97%97%E8%88%B0%E8%AE%BE%E5%A4%87%E4%B8%8A%E6%9B%B4%E5%A4%A7%E7%9A%84/

安卓全面屏适配需要改最大分辨率,AndroidManifest的application里面加这句就可以

<meta-data android:name="android.max_aspect" android:value="2.1" />

下面是完整AndroidManifest

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.Snoopy.AndroidTest"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="21" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name">
        <activity
            android:name=".MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
      <meta-data android:name="android.max_aspect" android:value="2.1" />
    </application>

</manifest>

猜你喜欢

转载自blog.csdn.net/SnoopyNa2Co3/article/details/84746708