更新记录

1.0.12(2026-05-07)

发版

1.0.11(2026-05-07)

发版

1.0.10(2026-05-07)

发版

查看更多

平台兼容性

ai-AlternateIcons

动态设置 app 桌面图标 可用于节日或暗黑模式适配(iOS)

示例:

使用教程

import { iOSTools } from '@/uni_modules/ll-AlternateIcons';

是否支持动态设置 icon

let isSupport = iOSTools.supportsAlternateIcons();

获取当前 icon

let lastIcon = iOSTools.getIconName();

设置 icon 入参 icon name

iOSTools.setAlternateIconName('fine');

其它工具(拨打电话)

iOSTools.callphone('***');

其它工具(拷贝)

iOSTools.copy('***');

其它工具(黏贴)

iOSTools.readCopyData(function (data: string) {
    uni.showToast({
        icon: 'none',
        title: data
    });
});
  • 配置 项目根目录创建Info.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>CFBundleIcons</key>
    <dict>
        <key>CFBundleAlternateIcons</key>
        <dict>
            <key>cloudy</key>
            <dict>
                <key>CFBundleIconFiles</key>
                <array>
                    <string>cloudy</string>
                </array>
                <key>UIPrerenderedIcon</key>
                <false/>
            </dict>
            <key>fine</key>
            <dict>
                <key>CFBundleIconFiles</key>
                <array>
                    <string>fine</string>
                </array>
                <key>UIPrerenderedIcon</key>
                <false/>
            </dict>
            <key>heavyrain</key>
            <dict>
                <key>CFBundleIconFiles</key>
                <array>
                    <string>heavyrain</string>
                </array>
                <key>UIPrerenderedIcon</key>
                <false/>
            </dict>
            <key>snow</key>
            <dict>
                <key>CFBundleIconFiles</key>
                <array>
                    <string>snow</string>
                </array>
                <key>UIPrerenderedIcon</key>
                <false/>
            </dict>
            <key>sprinkles</key>
            <dict>
                <key>CFBundleIconFiles</key>
                <array>
                    <string>sprinkles</string>
                </array>
                <key>UIPrerenderedIcon</key>
                <false/>
            </dict>
        </dict>
        <key>CFBundlePrimaryIcon</key>
        <dict>
            <key>CFBundleIconFiles</key>
            <array>
                <string></string>
            </array>
            <key>UIPrerenderedIcon</key>
            <false/>
        </dict>
        <key>UINewsstandIcon</key>
        <dict>
            <key>CFBundleIconFiles</key>
            <array>
                <string></string>
            </array>
            <key>UINewsstandBindingEdge</key>
            <string>UINewsstandBindingEdgeLeft</string>
            <key>UINewsstandBindingType</key>
            <string>UINewsstandBindingTypeMagazine</string>
        </dict>
    </dict>
</dict>
</plist>
  • 在项目根目录创建资源,如下

    注意,icon 资源需要 2x、3x 图,icon 名字需要与Info.plist配置相同,不同则会找不到

nativeResources/
└── ios
    └── Resources
        ├── snow@2x.png
        ├── snow@3x.png
        ├── fine@2x.png
        └── fine@3x.png

遥祝各位老板:生意兴隆通四海,财源茂盛达三江

项目推荐:(点击前往)

AI绘画
塔罗牌
面相
白噪声

隐私、权限声明

1. 本插件需要申请的系统权限列表:

2. 本插件采集的数据、发送的服务器地址、以及数据用途说明:

3. 本插件是否包含广告,如包含需详细说明广告表达方式、展示频率:

暂无用户评论。