Bor*_*rja 62 notifications android android-notification-bar android-5.0-lollipop
我有这个代码:
Notification notif;
// Build notification
Notification.Builder notifBuilder = new Notification.Builder(context);
notifBuilder.setContentIntent(pendingIntent);
notifBuilder.setContentTitle(title);
notifBuilder.setSmallIcon(icon_resId);
notifBuilder.setContentText(ne.getCaption());
notifBuilder.setDefaults(Notification.DEFAULT_ALL);
notifBuilder.setAutoCancel(autocancel);
notifBuilder.setWhen(System.currentTimeMillis());
notif = notifBuilder.build();
Run Code Online (Sandbox Code Playgroud)
在Android 4.4中运行良好.
但是,在Android 5.0中,状态栏中显示的图标是白色方块.设备锁定时显示的新"通知正文"中显示的图标是正确的.
在http://developer.android.com/reference/android/app/Notification.Builder.html中,我没有看到有关API级别21的通知图标的任何新内容
por*_*cus 31
查看文档:http: //developer.android.com/design/style/iconography.html
有句话:"通知图标必须完全是白色的.此外,系统可能会缩小和/或使图标变暗."
Bor*_*rja 29
我已经解决了将图标大小更改为16x16像素并仅使用白色的问题
| 归档时间: |
|
| 查看次数: |
61806 次 |
| 最近记录: |