如何在iOS 10+中自定义通知的简短预览 [英] How to customize short preview of notifications in iOS 10+
问题描述
I watched WWDC Introduction to Notifications, Advanced Notifications, and Best Practices, and read UNNotificationContentExtension
. All of these show that I can implement Notification Content extension to customize notification presentation. But to me it seems that they all assume that we can customize only the expanded view (the view that opens up when we 3D press the short preview).
现在,我知道我可以以非常有限的方式自定义简短预览的显示方式-使用标题/正文,可以决定我要加粗字体还是普通字体;通过使用
Now I know that I can customize the presentation of the short preview in a very restricted way - using title/body I can decide if I want a bold or normal font; by using Notification Service extension I can add a media preview. However, what I need is to be able to build the UI of this short preview myself - add custom UIImageView
, etc. Right now it seems that this is not possible, but I wasn't able to find any explicit information that would confirm it.
所以我的问题是:我们可以自定义通知的简短预览吗?如果不是,那么官方文档中是否有任何明确的说明可以解释这一点?如果是,您能推荐我一些文档/教程吗?
So my question is: Can we customize the short preview of a notification? If not, is there any explicit statement in official docs that explain this? If yes, can you refer me to some docs/tutorials on how to do it?