最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

[无法解决]swift如何设置本地通知的图片

Swift crifan 1987浏览 0评论

看到了有个属性:

    public var alertLaunchImage: String? // used as the launch image (UILaunchImageFile) when launch button is tapped

但是想要去设置时:

        localNotif.alertLaunchImage = ""

却又不知道设置哪个图片:

如果像官网说的:

iOS Human Interface Guidelines: Notifications

去设置app的logo的话

但是

iOS Human Interface Guidelines: Icon and Image Sizes

中,却没有提到对应的通知的图片的大小。。。

搜:

ios notification image size

objective c – What is the size of Local notification custom image icon in iOS – Stack Overflow

iOS and Android Icon Sizes | Undefined Value

搜:

ios notification image

iphone – iOS push/local notifications with image like in iMessage – Stack Overflow

ios local notification image

ios – How to set an image and sound for local notifications? – Stack Overflow

-》

不允许

-》默认的本地通知的图片,只能是,iOS自己主动的把你的app的logo图片,缩小到对应尺寸的,用于本地通知的图片,你是不能改的。

ios – Customizing UILocalNotification’s alert – Stack Overflow

ios – Custom image in Local Notification – Stack Overflow

好像是:

通知的logo的图片的大小是29×29 ?

难道是这个:

好像:

iOS and Android Icon Sizes | Undefined Value

中也是说的是:

29 x 29

swift local notification image

Local Notification Tutorial in iOS8 with Swift – iOScreator

[总结]

除了之前的:

[workaround]swift本地通知的alertTitle没生效

此处的本地通知的图片也是不允许设置的。

系统会默认,只能显示出app的logo小图片。大小是29×29.

而alertLaunchImage,指的是:

用户点击了通知后,调用打开app时的启动界面。

不是此处希望的通知的图片。

转载请注明:在路上 » [无法解决]swift如何设置本地通知的图片

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
91 queries in 0.183 seconds, using 22.08MB memory