相关疑难解决方法(0)

设置为通知时,大图片正在裁剪

我想在Android通知栏中显示大图片样式图片.但是我遇到了问题 - >当我使用以下代码在通知栏中设置图像时:

PendingIntent resultPendingIntent = stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT);
            NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(ctx)
            .setSmallIcon(R.drawable.ic_launcher)
            .setContentTitle(title)
            .setContentText(message)
            .setOngoing(false)
            .setAutoCancel(true)
            .setStyle(new NotificationCompat.BigPictureStyle()
            .bigPicture(bitmap))
            .setPriority(Notification.PRIORITY_HIGH)
            //.setStyle(new NotificationCompat.BigTextStyle().bigText(message))
            .setContentIntent(resultPendingIntent);
            // mId allows you to update the notification later on.
            mBuilder.setSound(Settings.System.DEFAULT_NOTIFICATION_URI);
            mBuilder.setDefaults(Notification.DEFAULT_VIBRATE);
            NotificationManager mNotificationManager = (NotificationManager) ctx.getSystemService(Context.NOTIFICATION_SERVICE);
            mNotificationManager.notify(0 , mBuilder.build());
Run Code Online (Sandbox Code Playgroud)

它始终从左右角落裁剪.我不想使用远程视图.任何人都可以告诉我可以放在通知栏中的图像的大小和分辨率,不应该被裁剪.

谢谢

android push-notification remoteview

3
推荐指数
2
解决办法
8740
查看次数

标签 统计

android ×1

push-notification ×1

remoteview ×1