How do I create a transparent Activity on Android?

前端 未结 22 2197
忘掉有多难
忘掉有多难 2020-11-21 04:43

I want to create a transparent Activity on top of another activity.

How can I achieve this?

22条回答
  •  清酒与你
    2020-11-21 05:38

    Add the following style in your res/values/styles.xml file (if you don’t have one, create it.) Here’s a complete file:

    
    
      
    
    

    (The value @color/transparent is the color value #00000000 which I put in the res/values/color.xml file. You can also use @android:color/transparent in later Android versions.)

    Then apply the style to your activity, for example:

    
    ...
    
    

提交回复
热议问题