簡體   English   中英

如何更改 libgdx android 項目的應用程序圖標

[英]How to change application icon for a libgdx android project

我正在嘗試更改用於開發游戲的 libGDX 項目的應用程序圖標。 他們提供了一個示例ic_launcher.png文件用於設置應用程序圖標,我正在嘗試將其更改為不同的 png 文件。 我已經為 mdpi、hdpi、xhdpi、xxhdpi 和 xxxhdpi 以及 anydpi 指定了所有內容,但是在AndroidManifest.xml中,當我想將圖標更改為@drawable/my_launcher時,它說這是一個無效符號。 我什至指定了與提供的ic_launcher.png相同的長度和寬度。 這是AndroidManifest.xml文件。

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="org.zunkuftedu.zunkuftlife" >

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:isGame="true"
        android:appCategory="game"
        android:label="@string/app_name"
        android:theme="@style/GdxTheme" >
        <activity
            android:name="org.zunkuftedu.zunkuftlife.AndroidLauncher"
            android:label="@string/app_name" 
            android:screenOrientation="landscape"
            android:configChanges="keyboard|keyboardHidden|navigation|orientation|screenSize|screenLayout">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

這是一個libGDX項目,所以它不同於普通的 Android Studio 項目。 任何幫助將不勝感激。

您不需要更改任何代碼。 android\res文件夾包含帶有不同分辨率圖標的文件夾。 您可以簡單地用您自己的自定義圖像覆蓋每個文件夾中的 ic_launcher.png 文件(確保您匹配每個文件夾中現有圖像的大小)。 我就是這樣做的,而且效果很好。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM