android - BigPictureStyle 通知在小米 MIUI-8 中无法正确显示

标签 android android-notifications

我想使用以下代码在 MiUi 中显示一个 bigPictureStyle 通知(不想使用自定义 View )--

NotificationCompat.Builder mBuilder =
            new NotificationCompat.Builder(this)
                    .setSmallIcon(R.mipmap.ic_launcher)
                    .setContentTitle(title)
                    .setContentText(msg)
                    .setStyle(new NotificationCompat.BigPictureStyle()
.bigPicture(BitmapFactory.decodeResource(getResources(), R.drawable.b))
                                        .setBigContentTitle(title));
NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
mNotificationManager.notify(10, mBuilder.build());

它在原始 android 上完美运行,但在 Xiaomi MIUI 8(基于 Android Lollipop)中,它在扩展通知 View 的底部显示阴影,如图所示--

MIUI8 expanded notification having black shadow at the bottom

如何去除这个底部阴影

最佳答案

目前唯一的解决方案是使用具有相似外观的大内容 View 的自定义 View 。

关于android - BigPictureStyle 通知在小米 MIUI-8 中无法正确显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43245815/

相关文章:

虚拟机 (VMWare) 内的 Android E(ICS/4.0) 模拟器

java - Android AsyncTask 订单服务器连接

java - 更改 Android Listview ArrayAdapter 中最后一项的布局

Android FCM通知分组

android - 如何在android中创建异步通知

android - 换行符在 Notifications android studio 中不起作用

android - 平台证书”在 root 的 android 手机中

android - 我无法使用带有图像 url 的 html 代码在 webview 中加载图像

java - 为通知创建 PendingIntent 而不指定 Activity

java - android.app.RemoteServiceException : Bad notification for startForeground