Atu*_*v A 16

BigPictureStyle的通知图像大小

最低 - 512x256

平衡 - 1024x512

最大 - 2048x1024

得到了这个答案/sf/answers/2337372761/

注意:在较小的设备(800x480)中,仍然存在中心作物


Abh*_*bhi -1

要使通知显示在展开视图中,请首先使用所需的普通视图选项创建一个NotificationCompat.Builder 对象。接下来,使用展开的布局对象作为参数调用 Builder.setStyle()。

请记住,扩展通知在 Android 4.1 之前的平台上不可用。要了解如何处理 Android 4.1 和早期平台的通知,请阅读处理兼容性部分。

例如,以下代码片段演示了如何更改在上一个代码片段中创建的通知以使用扩展布局:

NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this)
.setSmallIcon(R.drawable.notification_icon)
.setContentTitle("Event tracker")
.setContentText("Events received")
NotificationCompat.InboxStyle inboxStyle =
    new NotificationCompat.InboxStyle();
String[] events = new String[6];
// Sets a title for the Inbox in expanded layout
inboxStyle.setBigContentTitle("Event tracker details:");
...
// Moves events into the expanded layout
for (int i=0; i < events.length; i++) {
  inboxStyle.addLine(events[i]);
}
// Moves the expanded layout object into the notification object.
mBuilder.setStyle(inboxStyle);
...
// Issue the notification here.
Run Code Online (Sandbox Code Playgroud)

您还可以参考此链接,将扩展布局应用于通知