Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/210.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2008/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 安卓->;imageview的透明背景_Android_Background_Imageview_Png_Transparent - Fatal编程技术网

Android 安卓->;imageview的透明背景

Android 安卓->;imageview的透明背景,android,background,imageview,png,transparent,Android,Background,Imageview,Png,Transparent,在我的应用程序中,我有一个CameraPreview。我想在上面添加一个imageView,所以我需要imageView有一个透明的背景。imageView的src将是png,因此我可以看到下面的CameraPreview 但是,我好像已经尝试了所有方法来管理ImageViewTransparent的背景: 更改alpha值(在代码和xml文件中) 将背景更改为@null,然后更改为#00000000(在代码和xml文件中都有) 但还是不行 我错过什么了吗 请询问是否需要我的部分代码。 P好

在我的应用程序中,我有一个
CameraPreview
。我想在上面添加一个imageView,所以我需要imageView有一个透明的背景。imageView的src将是png,因此我可以看到下面的CameraPreview

但是,我好像已经尝试了所有方法来管理
ImageView
Transparent的背景:

  • 更改alpha值(在代码和xml文件中)

  • 将背景更改为@null,然后更改为
    #00000000
    (在代码和xml文件中都有)

但还是不行

我错过什么了吗

请询问是否需要我的部分代码。
P

好的,谢谢你的回答,但我已经设法解决了我的问题: 我给布局的背景添加了随机颜色(例如#ff340355544),并将前两个字母改为00,使#0034035544。


最后很简单

使您的
Src图像背景透明
在xml文件中设置android:Background=“@android:color/Transparent”您可以发布代码吗?你已经试过了吗