Sus*_*ant 9 notifications icons android android-5.0-lollipop
我正在尝试这段代码,
NotificationCompat.Builder nfBuilder = new NotificationCompat.Builder(
context)
..setContentTitle(
"XYZ")
.setContentText("ABC")![enter image description here][1]
.setContentIntent(pIntent)
.setDefaults(Notification.DEFAULT_ALL)
.setOnlyAlertOnce(true)
.setAutoCancel(true)
.setPriority(Notification.PRIORITY_HIGH)
.setSmallIcon(R.drawable.woj_ic_launcher);
Notification notification = nfBuilder.build();
NotificationManager nfManager = (NotificationManager) context
.getSystemService(Context.NOTIFICATION_SERVICE);
nfManager.notify(requestCode, notification);
Run Code Online (Sandbox Code Playgroud)
问题是,它适用于所有其他平台,但使用棒棒糖,它显示非常小的图标,周围有灰色圆圈.我尝试更改图标大小并使用setLargeIcon()方法,但仍然没有乐趣.

图像应具有正方形比例。使用此工具(https://romannurik.github.io/AndroidAssetStudio/icons-notification.html),然后确保使用“Api v11”图标,因为它们具有您需要的方形比例,旧版本有一点更高的高度。
回顾:我必须告诉你,我并没有真正看到你的图标太小,事实上,这是我能得到的最大图标尺寸,看......
对于“灰色”背景问题,Notification.Builder.setColor(Color.RED)之类的东西不适合您吗?
| 归档时间: |
|
| 查看次数: |
4013 次 |
| 最近记录: |