更新记录
1.0.1(2025-05-24)
发新版本
1.0.0(2025-05-24)
发版
平台兼容性
ll-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("17600773483")
其它工具(拷贝)
iOSTools.copy("17600773483")
其它工具(黏贴)
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
遥祝各位老板:生意兴隆通四海,财源茂盛达三江
主营业务:
1、承接各种app、小程序、管理后台开发;
2、app代上架、马甲包制作、华为、苹果、小米市场上架等;
3、小程序、app备案、软著申请服务等;
4、网赚项目源码出售、接入流量主广告;
