我目前在Android Oreo上遇到问题,即在状态栏中和通知本身上正确显示了通知图标(以下提供的屏幕截图)。

要创建图标,我正在使用Android 3.1,右键单击res文件夹,然后选择“新建”>“图像资产”。其中,我要上传全白png(根据文档),并根据屏幕截图选择红色背景:

android - Oreo(8.0)状态栏通知图标全白-LMLPHP

在AndroidManifest.xml中,我将图标设置如下:

<application... android:icon="@mipmap/ic_launcher"

实际的应用程序看起来正确,但是通知图标未正确显示。

通知图标错误:

android - Oreo(8.0)状态栏通知图标全白-LMLPHP

android - Oreo(8.0)状态栏通知图标全白-LMLPHP

最佳答案

您需要根据this创建图标

另外你需要添加

<meta-data
    android:name="com.google.firebase.messaging.default_notification_icon"
    android:resource="@drawable/statusbar_notification" />


在AndroidManifest中

关于android - Oreo(8.0)状态栏通知图标全白,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/49736012/

10-11 22:52
查看更多