Oreo(8.0)状态栏通知图标全白 [英] Oreo (8.0) status bar notification icon all white

查看:163
本文介绍了Oreo(8.0)状态栏通知图标全白的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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



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





解决方案

您需要按照


创建图标

还需要添加

 <元数据
android:name = com.google.firebase.messaging.default_notification_icon
android:resource = @ drawable / statusbar_notification />

AndroidManifest


I'm currently having problems with Android Oreo showing the notification icon correctly in the status bar and on the notification itself (screenshots provided below).

To create the icons, I am using Android 3.1, right clicking on the res folder and choosing New > Image Asset. Within that, I'm uploading an all white png (as per docs) and selecting a red background as per screenshot:

Within the AndroidManifest.xml, I set the icon like this:

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

The actual App looks correct, but the notification icon does not show up correctly.

Notification icon errors:

解决方案

You need to create icon as per this

Also you need to add

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

in AndroidManifest

这篇关于Oreo(8.0)状态栏通知图标全白的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆