Most visited

Recently visited

Added in API level 16

Notification.BigPictureStyle

public static class Notification.BigPictureStyle
extends Notification.Style

java.lang.Object
   ↳ android.app.Notification.Style
     ↳ android.app.Notification.BigPictureStyle


帮助程序类用于生成包含大图像附件的大幅面通知。 以下是您如何设置通知上的BigPictureStyle的方法:

 Notification notif = new Notification.Builder(mContext)
     .setContentTitle("New photo from " + sender.toString())
     .setContentText(subject)
     .setSmallIcon(R.drawable.new_post)
     .setLargeIcon(aBitmap)
     .setStyle(new Notification.BigPictureStyle()
         .bigPicture(aBigBitmap))
     .build();
 

也可以看看:

Summary

Inherited fields

From class android.app.Notification.Style

Public constructors

Notification.BigPictureStyle()
Notification.BigPictureStyle(Notification.Builder builder)

此构造函数在API级别24中已弃用。请使用BigPictureStyle()

Public methods

Notification.BigPictureStyle bigLargeIcon(Bitmap b)

显示大通知时覆盖大图标。

Notification.BigPictureStyle bigLargeIcon(Icon icon)

显示大通知时覆盖大图标。

Notification.BigPictureStyle bigPicture(Bitmap b)

提供要用作BigPicture通知的有效内容的位图。

Notification.BigPictureStyle setBigContentTitle(CharSequence title)

覆盖模板大表单中的ContentTitle。

Notification.BigPictureStyle setSummaryText(CharSequence cs)

将详细信息部分的第一行设置为模板的大表格。

Inherited methods

From class android.app.Notification.Style
From class java.lang.Object

Public constructors

Notification.BigPictureStyle

Added in API level 16
Notification.BigPictureStyle ()

Notification.BigPictureStyle

Added in API level 16
Notification.BigPictureStyle (Notification.Builder builder)

此构造函数在API级别24中已被弃用。
使用BigPictureStyle()

Parameters
builder Notification.Builder

Public methods

bigLargeIcon

Added in API level 16
Notification.BigPictureStyle bigLargeIcon (Bitmap b)

显示大通知时覆盖大图标。

Parameters
b Bitmap
Returns
Notification.BigPictureStyle

bigLargeIcon

Added in API level 23
Notification.BigPictureStyle bigLargeIcon (Icon icon)

显示大通知时覆盖大图标。

Parameters
icon Icon
Returns
Notification.BigPictureStyle

bigPicture

Added in API level 16
Notification.BigPictureStyle bigPicture (Bitmap b)

提供要用作BigPicture通知的有效内容的位图。

Parameters
b Bitmap
Returns
Notification.BigPictureStyle

setBigContentTitle

Added in API level 16
Notification.BigPictureStyle setBigContentTitle (CharSequence title)

覆盖模板大表单中的ContentTitle。 这默认为传递给setContentTitle()的值。

Parameters
title CharSequence
Returns
Notification.BigPictureStyle

setSummaryText

Added in API level 16
Notification.BigPictureStyle setSummaryText (CharSequence cs)

将详细信息部分的第一行设置为模板的大表格。

Parameters
cs CharSequence
Returns
Notification.BigPictureStyle

Hooray!