问题
I am creating a custom notification layout for my application.
NotificationCompat.Builder builder = new NotificationCompat.Builder(context, NOTIFICATION_CHANNEL_ID)
.setSmallIcon(R.drawable.ic_notification_icon)
.setPriority(NotificationCompat.PRIORITY_DEFAULT)
.setCustomContentView(notificationLayoutCollapsed)
.setOngoing(playing)
.setCustomBigContentView(notificationLayoutExpanded)
.setStyle(new NotificationCompat.DecoratedCustomViewStyle())
.setContentIntent(pendingIntent);
My notification layout does not have internal padding or margins yet there it shows margins for the notification (Thick white border around blue notification).
Please suggest a solution to this issue.
----ANSWER-----
Culprit is this following line
.setStyle(new NotificationCompat.DecoratedCustomViewStyle())
DecoratedCustomViewStyle gives the notification a border
来源:https://stackoverflow.com/questions/57028419/custom-notification-layout-gives-unnecessary-margin