Custom dialog opens full screen

后端 未结 3 1280
失恋的感觉
失恋的感觉 2021-01-18 19:20

I\'m developing an Android application and I have a question about custom dialogs.

I do this to open a custom dialog:

protected void showSetFriendEma         


        
相关标签:
3条回答
  • 2021-01-18 19:52

    you have to use android.R.style.Theme.Dialog instenad of android.R.style.Theme_DeviceDefault

    0 讨论(0)
  • 2021-01-18 19:53

    Just make a custom style and apply it to dialog...

    <style name="full_screen_dialog" parent="@android:style/Theme.Dialog">
        <item name="android:windowNoTitle">true</item>
        <item name="android:windowFullscreen">true</item>
        <item name="android:windowIsFloating">true</item>
        <item name="android:windowContentOverlay">@null</item>
        <item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item>
        <item name="android:windowSoftInputMode">stateUnspecified|adjustPan</item>
        <item name="android:windowBackground">@android:color/transparent</item>
    </style>
    
    0 讨论(0)
  • 2021-01-18 20:06

    Use R.style.Theme_AppCompat_Dialog in order to get the proper dialog.

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