Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在我的 android 应用程序中,我下载了一些 png 图像并将它们写入 sd 卡。当我在图像视图中显示它们时,它们显示为黑色背景。原始图像具有透明背景。如何保持背景透明。请帮我。我使用PNG格式压缩并写入SD卡
将视图背景设置为
R.color.transparent
或在 xml 中
android:background="@android:color/transparent"
编辑:
谢谢您的回复。是的,我这样做了。我刚刚做了另一件事,我设置了画布颜色 android.R.color.transparent 并且它起作用了