简体   繁体   中英

How to create semi-transparent activity/menu in android

How to achieve a menu similar to this one in the image? How can I display such a menu with semi-transparent background where I can see camera preview. What is the name of that kind of menu?

在此处输入图片说明

Set semi transparent or fully transparent color to your layout(menu layout) background. Below I have mentioned color code with transparency level

Black - "#000000"  

100% Transparent"#00000000"

100% Opaque "#FF000000"

50% Transparent "#80000000" (This one you can use in your case)

For more details regarding Android color code you can check https://stackoverflow.com/a/17239853/1140237

use this code

 <style name="MyTheme" parent="android:Theme">
         <item name="android:panelFullBackground">{your color or drawable}</item>
    </style>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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