简体   繁体   English

ANDROID-> imageview的透明背景

[英]ANDROID -> transparent background for imageview

In my application I have a CameraPreview . 在我的应用程序中,我有一个CameraPreview I would like to add an imageView over it so I need the imageView to have a transparent background. 我想在上面添加一个imageView,所以我需要imageView具有透明的背景。 The src of the imageView will be a png so I could see the CameraPreview underneath. imageView的src将是png,因此我可以在下面看到CameraPreview。

However, it's like I've tried everything to manage the background of the ImageView Transparent: 但是,就像我已经尽一切努力来管理ImageView Transparent的背景一样:

  • change the alpha value (in the code AND in the xml file) 更改Alpha值(在代码AND和xml文件中)

  • change the background to @null then to #00000000 (in the code AND in the xml file for both) 将背景更改为@null,然后更改为#00000000 (在代码AND和xml文件中)

But it still not work ! 但这仍然行不通!

Did I miss anything ? 我错过了什么吗?

Please ask if you need parts of my code. 请询问您是否需要我的代码的一部分。 P P

Ok thanks for your answears but I have managed to solve my problem: I gave a random color to the background of my layout (for example #FF34035544) and I changed the two first letters to 00 which made #0034035544. 好的,谢谢您的回答,但是我已经设法解决了我的问题:我为布局的背景设置了随机颜色(例如,#FF34035544),然后将前两个字母更改为00,这使#0034035544变了。 It was finally very simple ! 终于很简单!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM