Android - Activity that does not fill the parent screen

后端 未结 2 1534
自闭症患者
自闭症患者 2020-12-08 17:12

Any idea why this doesn\'t create an activity that looks like a popup instead of an activity that completely fills the screen?

 

        
相关标签:
2条回答
  • 2020-12-08 18:05

    You must set your Activity's window to be floating. You can do this either by giving your activity the Dialog style defined by Android (android:style/Theme.Dialog), or define your own style, like this:

    <style name="MyFloatingWindow">
        <item name="android:windowBackground">@android:color/transparent</item>
        <item name="android:background">@android:color/transparent</item>
        <item name="android:windowIsFloating">true</item>
        <item name="android:windowNoTitle">true</item>
    </style>
    

    Then set the style on your activity in the application's Manifest.

    0 讨论(0)
  • 2020-12-08 18:14

    On my phone but check this website here it shows how to use PopupWindow correctly.

    Hope this helps or points you in the right direction.

    0 讨论(0)
提交回复
热议问题