启动器图标在模拟器上显示,但在手机上没有显示。

4

如标题所述,我的启动器图标在模拟器上显示正常,但在我的手机上显示默认图标。

以下是我的AndroidManifest.xml文件:

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

    <uses-sdk android:minSdkVersion="10" />

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

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

    <uses-permission android:name="android.permission.INTERNET"></uses-permission>


</manifest>
3个回答

3
很可能,您只在其中一个drawable文件夹中使用了您的图标替换默认图标,并且恰巧模拟器正在使用该文件夹,而您的设备正在使用其他文件夹之一。请参考此链接获取有关图标设计指南的信息,以及此链接获取推荐大小的信息。

2
我使用了http://android-ui-utils.googlecode.com/hg/asset-studio/dist/icons-launcher.html来创建图标,经过一番折腾终于成功了。谢谢! - ytz

2

你能否发布所有drawable文件夹中的内容?

你可能已经做过这样的事情:将drawable-mdpi文件夹中的ic_launcher.png文件替换为另一张图片(你的启动器图标)并将其命名为ic_launcher.png。

实际上,你不需要重命名你放在drawable文件夹中的图标文件,但是你需要更改Android清单以告诉应用程序使用哪个文件作为启动器图标。

假设我将launcher_icon.png放在drawable-mdpi文件夹中,并且我希望它成为我的启动器图标,我将更改清单如下:

<application
    android:icon="@drawable/launcher_icon"
    android:label="@string/app_name" >

我已经修改了标签

android:icon="@drawable/ic_launcher"

android:icon="@drawable/launcher_icon"

请将你的启动图标粘贴并根据该图像文件名进行更改...


0
如果你已经正确放置了图标,但是仍然看不到图标更改,请前往项目(Project)->清理(Clean...)
bin文件夹中的res文件夹中,您将找到所有资源项。在清理项目之前可以检查,您将发现旧的ic_launcher文件。如果您清理了项目,这些文件夹将被删除。当您再次运行您的应用程序时,一组新的文件将被复制,并且您的应用程序图标将更改。
希望这会有所帮助。
注意:只有在您替换了所有文件夹中的图标,却仍然得到旧图标时,此方法才有效。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接