我正在将具有透明背景的PNG图像更改为HEIC格式。我想使用Android Studio的ImageView显示修改后的图像。为了使用HEIC文件,我使用了素材资源文件夹和ImageDecoder。
但是,HEIC的透明背景变为黑色。 我在各种网站上都将png转换为heic,并使用Mac预览应用程序将其导出,但无法阻止背景变黑。如果您解决了,我将不胜感激。
这是我的代码:
Project!
<androidx.appcompat.widget.AppCompatImageView
android:layout_width="287dp"
android:layout_height="557.5dp"
android:layout_marginStart="1.8dp"
android:background="@android:color/transparent"
android:id="@+id/main_character"
android:layout_alignParentBottom="true"/>