【发布时间】:2020-07-17 16:54:02
【问题描述】:
我已经尝试了一切,包括更改清单文件以及将图标属性放入通知功能,但通知图标仍然是白色圆圈!我的图标颜色是白色,透明背景是使用https://romannurik.github.io/AndroidAssetStudio/icons-notification.html#source.type=clipart&source.clipart=ac_unit&source.space.trim=1&source.space.pad=0&name=ic_stat_ac_unit 生成的。
我的清单文件如下所示:enter image description here
<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="@drawable/notification_icon" />
<meta-data
android:name="com.google.firebase.messaging.default_notification_color"
android:resource="@color/colorPrimary" />
我已经包含了我的文件夹结构的图片!我到底错过了什么?enter image description here
【问题讨论】:
-
据我所知,如果您的图标仍然是白色圆圈,则背景不透明。另外,我假设该图标是 png 图像?我已经完全成功地使用这个网站将我的 png 转换为具有透明背景的图标。 onlinepngtools.com/create-transparent-png 试试看?
-
@JideGuru 它是透明的,我也使用了你提到的网站,但结果还是一样!
-
附言。也许向我们展示您的可绘制文件夹中的文件列表。
-
您的保证透明图标的名称是“notification_icon.png”吗?它是否在 android/app/src/main/res 下的可绘制文件夹中?我知道这些看起来很愚蠢的问题,但通常这些问题的原因很简单。
-
PS jideGuru 刚刚编辑了您的帖子。 GrahamD 正在发表评论。
标签: android firebase flutter push-notification