【问题标题】:How to add Icon for your Live Wallpaper如何为您的动态壁纸添加图标
【发布时间】:2011-09-20 16:51:49
【问题描述】:

我的动态壁纸有一个图标,在你安装它之前它会显示,但是在你安装它并进入壁纸>动态壁纸之后,里面没有图标,它只是一个空的灰色图像。 我的动态壁纸有一个图标,它在您安装之前显示,但是在您安装它并转到壁纸>动态壁纸之后,里面没有图标,它只是一个空的灰色图像。

这是我的清单:

<?xml version="1.0" encoding="utf-8"?>
<manifest
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:versionName="1.0" package="com.cutecats.cats" 
    android:versionCode="1">
    <uses-sdk android:minSdkVersion="8" />



    <uses-feature android:name="android.software.live_wallpaper" />
    <application
        android:icon="@drawable/icon" 
        android:label="@string/app_name">
        <service
            android:name=".CubeWallpaper1"
            android:icon="@drawable/icon"
            android:permission="android.permission.BIND_WALLPAPER">
            <intent-filter android:icon="@drawable/icon">
                <action android:name="android.service.wallpaper.WallpaperService" />
            </intent-filter>
            <meta-data android:name="android.service.wallpaper" android:resource="@xml/cube1" />
        </service>
        <activity
            android:label="@string/cube2_settings"
            android:name=".CubeWallpaper1Settings"
            android:icon="@drawable/icon"
            android:exported="true" >
        </activity>
    </application>
</manifest>

【问题讨论】:

    标签: android icons live wallpaper


    【解决方案1】:

    据我了解,动态壁纸有不同类型的图标。每个节目都有自己的时间,而你所说的实际上是一个缩略图,需要放在里面

          <wallpaper> 
    

    标签。 我是这样做的:我使用以下代码创建了 pony.xml 文件:

         <?xml version="1.0" encoding="utf-8"?>
         <wallpaper xmlns:android="http://schemas.android.com/apk/res/android"
            android:thumbnail="@drawable/pony"
            android:description="@string/pony_desc"
         />
    

    在清单文件中我有以下内容:

      <service android:label="@string/pony" android:name="my.pony.wallpaperManagement.SleepyPonyWallpaper"
         android:permission="android.permission.BIND_WALLPAPER">
         <intent-filter>
            <action android:name="android.service.wallpaper.WallpaperService" />
         </intent-filter>
         <meta-data android:name="android.service.wallpaper"
            android:resource="@xml/pony" />
      </service>
    

    注意对 pony.xml 的引用。

    另外,不要忘记让您的图标大小合适(例如 64x64)。

    【讨论】:

    • 可能为时已晚,但如果它对其他人有帮助,请让我现在。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多