这就是我定义通知样式的方式:
NotificationCompat.BigPictureStyle notiStyle = new
NotificationCompat.BigPictureStyle();
notiStyle.setBigContentTitle(context.getString(R.string.notification_ticker));
notiStyle.setSummaryText(title);
notiStyle.bigPicture(map);
notiStyle.bigLargeIcon(map); //map - bitmap
但是位图太大,通知仅显示全幅图像并按高度裁切的图像,大图标显示图像中心的一小部分。
使用此代码,它可以帮助您:
Bitmap yourBitmap;
Bitmap resized = Bitmap.createScaledBitmap(yourBitmap, newWidth, newHeight, true);
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句