java - 矢量资产显示为白色,即使它是红色的
问题描述
我创建了名为 ic_live 的可绘制对象。该向量用于通知。
这是可绘制的代码:
<vector
android:height="24dp"
android:tint="#FE3A39"
android:viewportHeight="24"
android:viewportWidth="24"
android:width="24dp"
xmlns:android="http://schemas.android.com/apk/res/android">
<path
android:fillColor="#FE3A39"
android:pathData="M12,12m-10,0a10,10 0,1 1,20 0a10,10 0,1 1,-20 0"/>
</vector>
如您所见,tint 和 fillColor 都设置为红色,但在通知中,图像是白色的。
通知:
Notification notification = new NotificationCompat.Builder(this, App.CHANNEL_1_ID)
.setSmallIcon(R.drawable.ic_live)
.setContentTitle("LIVE")
.setPriority(NotificationCompat.PRIORITY_HIGH)
.setCategory(NotificationCompat.CATEGORY_MESSAGE)
.build();
notificationManager.notify(1, notification);
解决方案
推荐阅读
- ios - 带有 Mapbox 和 SwiftUI 的空白地图
- python - 基于字典的 Python 排列
- c# - 按公司名称过滤 Active Directory 用户,Asp.net Core 2.1
- c - 使用 for 循环计算 x 到 y 的幂
- arrays - 无法在列表中反映我添加的项目
- sql - 如何将两个日期之间的天数转换为 OracleSQL 中的数字?
- python - 如何使用 zipfile python 压缩文件夹
- ruby-on-rails - 微服务通信中如何组织延迟结果处理?
- c++ - 用c ++在winsock中重新连接需要做什么
- java - Spring Logback - SizeAndTimeBasedRollingPolicy 未创建日志文件