本文介绍了NotificationCompat Android-如何仅显示大图标而不显示小图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我添加通知时:
NotificationCompat.Builder mBuilder =
new NotificationCompat.Builder(this)
.setSmallIcon(R.drawable.plus)
.setContentTitle(title)
.setAutoCancel(true)
.setContentText(text)
.setSound(RingtoneManager .getDefaultUri(RingtoneManager.TYPE_NOTIFICATION))
.setLargeIcon(bm);
我看到大图标,小图标:
I see large icon and small in it:
如何只设置大图标,而不设置小图标.如果仅使用setLargeIcon,则根本看不到通知,只是发出声音警报.
How can I set only large Icon, without small.If use only setLargeIcon, I don't see notification at all, just sound alert.
推荐答案
必须使用小图标.如果您未设置较大的图标,则您的小图标会在圆圈中间变大,并带有您选择的颜色(setColor).
Small icon is mandatory.If you don't set a large one you'll get your small icon bigger in the middle of the circle with the color of your choice (setColor).
如果我是我,则将空白E放在透明背景上作为smallicon,然后为圆圈设置红色.
If i were you i'd put that blank E on a transparent background for smallicon, and set a red color for the circle.
这篇关于NotificationCompat Android-如何仅显示大图标而不显示小图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!