Activity with transparent background

前端 未结 6 502
南旧
南旧 2020-12-09 18:33

what I want to achieve is activity with dialog-like transparency with 100% visibility of RelativeLayout content. This is activity\'s xml:



        
6条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-09 19:06

    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 res/values/color.xml file. Later versions of Android define a transparent color for you, so with those versions you can use @android:color/transparent directly in the style and skip the color.xml step (note the additional android: in the definition))

    Then apply the style to your activity, for example:

    
    ...
    
    

    Taken from here.

提交回复
热议问题