Oreo(8.0)状态栏通知图标全白 [英] Oreo (8.0) status bar notification icon all white
问题描述
我目前在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屋!