我正在尝试开发图标更改功能,我打算使用来自Assets.xcassets
应用程序图标图像的图像。
我尝试在将数据添加到setAlternateIconName(_:completionHandler:)
之后更改应用程序图标,
但 Xcode 和 iOS 系统无法从. 我想使用来自App 图标的图像。有什么办法吗?CFBundleAlternateIcons
info.plist
Assets.xcassets
Assets.xcassets
提前致谢
我正在尝试开发图标更改功能,我打算使用来自Assets.xcassets
应用程序图标图像的图像。
我尝试在将数据添加到setAlternateIconName(_:completionHandler:)
之后更改应用程序图标,
但 Xcode 和 iOS 系统无法从. 我想使用来自App 图标的图像。有什么办法吗?CFBundleAlternateIcons
info.plist
Assets.xcassets
Assets.xcassets
提前致谢
不,您不能为此使用资产。但是,如果您的目的是为设备调整图像。只需添加一个后缀(例如 -@1x.png、-@2x.png、-@3x.png)
如果您想将 AppIcon 图像(在您的“主”.xcassets
包中)与 一起使用setAlternateIconName(_:completionHandler:)
,您应该:
如果要显示应用程序的主图标,请指定 nil
备用图标应位于任何.xcassets
捆绑包之外。正如您所提到的,似乎不支持设置备用图标。
来源:https ://developer.apple.com/documentation/uikit/uiapplication/2806818-setalternateiconname