【发布时间】:2018-07-20 05:04:48
【问题描述】:
[It is a sticker app I want to remove image background white color, I need a transparent image][1]
XML: Sticker view used for sticker adding in image view this sticker file going to save into phone gallery
<com.xiaopo.flying.sticker.StickerView
android:id="@+id/sticker_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
app:showBorder="false"
app:showIcons="false">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/cropped_image_view"
/>
</com.xiaopo.flying.sticker.StickerView>
Java:我为贴纸视图和图像视图设置了背景透明,但我在图库中获得了黑色背景图像,有任何选项可以删除背景颜色并将图像设置为透明程序化,
stickerView.setBackgroundColor(getResources().getColor(R.color.transparent));
stickerView.setBackgroundResource(R.color.transparent);
imageView.setBackgroundResource(R.color.transparent);
【问题讨论】:
-
提供更多细节。只有图片是不够的
-
我添加了xml和源代码