显示通知按钮图标

时间:2019-09-20 13:04:58

标签: c# android xamarin notifications

我无法在通知按钮上正确显示图标。显示一个按钮,但仅带有铭文,没有图标。我在任何地方都找不到解决方案。

请帮助我

var notificationManager = (NotificationManager)GetSystemService(NotificationService);


var notification = new NotificationCompat.Builder(this, ChannelId)
            .SetContentTitle("Test")
            .SetContentText("Test")
            .SetSmallIcon(Resource.Drawable.warning)
            .SetContentIntent(BuildIntentToShowMainActivity())     
            .AddAction(Resource.Drawable.stop,"Stop", BuildIntenetToStopService())              
            .Build();            

notificationManager.Notify(notificationId, notification);

0 个答案:

没有答案