jjzjj

setSmallIcon

全部标签

android - 如何使用 Android 支持库 23.2 将 vectorDrawable 用作推送通知的图标? setSmallIcon 给出错误

我的应用程序在APIandroid{defaultConfig{vectorDrawables.useSupportLibrary=true}}除推送通知图标外,所有View均正常:NotificationCompat.BuildermBuilder=newNotificationCompat.Builder(this).setColor(getResources().getColor(R.color.colorAccent)).setSmallIcon(R.drawable.ic_play_arrow_white_24dp)//ERROR.setContentTitle(getStr

android - 在 InboxStyle 通知的右下角添加图标

我正在尝试添加一个图标,如上图中数字5所示。我正在使用InboxStyle类和NotificationCompat.Builder来构建它。我已经调用了setSmallIcon没有运气。有什么想法吗?谢谢! 最佳答案 事实证明,这只是新版Android的设计更改。在Android5.0Lollipop之前,setLargeIcon将大图标设置在左侧,setSmallIcon将小图标设置在最右侧,如您所料。从Android5.0开始,setSmallIcon会在大图标的右下角叠加一个小图标。据我所知,没有办法让小图标出现在Lollip

android - NotificationCompat 4.1 SetSmallIcon 和 SetLargeIcon

我使用这个简单的代码在Android4.1或更高版本中设置通知。它运作良好,但我的问题来自SmallIcon和LargeIcon。我了解SmallIcon显示在状态栏中,LargeIcon显示在下拉列表中。NotificationCompat.Builderbuilder=newNotificationCompat.Builder(this);builder.setTicker("Theticker");builder.setContentTitle("Thetitle");builder.setContentText("Thetext");builder.setSmallIcon(R

android - NotificationCompat 4.1 SetSmallIcon 和 SetLargeIcon

我使用这个简单的代码在Android4.1或更高版本中设置通知。它运作良好,但我的问题来自SmallIcon和LargeIcon。我了解SmallIcon显示在状态栏中,LargeIcon显示在下拉列表中。NotificationCompat.Builderbuilder=newNotificationCompat.Builder(this);builder.setTicker("Theticker");builder.setContentTitle("Thetitle");builder.setContentText("Thetext");builder.setSmallIcon(R

带有级别列表的android通知setSmallIcon

我正在使用Notification.Builder创建通知。对于此通知,我使用级别列表作为小图标mNotificationBuilder.setSmallIcon(R.drawable.icon_levellist,levelInt);这会将状态栏中的图标设置为正确的级别,但是当下拉通知时,图标会设置为默认级别。我已经尝试使用自定义布局来显示它并且它有效,但是我希望能够使用Notification.Builder附带的默认布局。这是一个错误吗? 最佳答案 我认为这是一个错误,因为我遇到了同样的事情你可以给这个问题加注星标:http: