Icon加载资源图片显示黑色 发表于 2022-12-29 更新于 2023-09-19 分类于 Jetpack Compose Icon加载资源图片显示黑色 Painter: 12//获取图片资源,R.drawable.xx或者R.mipmap.xxIcon(painter = painterResource(id = R.mipmap.head_icon), null) 效果如图: Icon加载资源图片显示黑色没有加载出图片?别慌,因为默认的tint模式是AmbientContentColor.current,我们需要去掉它默认的着色模式,所以需要将tint的属性设置为Color.Unspecified 12//获取图片资源,R.drawable.xx或者R.mipmap.xxIcon(painter = painterResource(id = R.mipmap.head_icon), null, tint = Color.Unspecified) 此时图片的显示效果就正常了 -------------本文结束感谢您的阅读------------- 本文标题:Icon加载资源图片显示黑色 文章作者:Vinx 发布时间:2022年12月29日 - 17:20 最后更新:2023年09月19日 - 11:38 原始链接:https://blog.vinkvin.com/post/42/ 许可协议: 署名-非商业性使用-禁止演绎 4.0 国际 转载请保留原文链接及作者。