How to change DIalog window size Android studio

Viewed 97

I'm trying to implement an activity with a dialog theme. My manifest.xml

<activity android:name=".activity.AddShow"
android:theme="@style/CustomDialog">

The problem is that I want to increase the dialog width. How can I achieve this? I tried with: styles.xml

<style name="CustomDialog" parent="Theme.AppCompat.Light.Dialog">
        <item name="android:windowIsTranslucent">true</item>
        <item name="android:backgroundDimEnabled">false</item>
        <item name="android:windowIsFloating">false</item>
</style>

But I have this problem at bottom and top: enter image description here

1 Answers

Finally, easy solution:

<style name="CustomDialog" parent="Theme.AppCompat.Light.Dialog">
        <item name="android:windowMinWidthMajor">99%</item>
        <item name="android:windowMinWidthMinor">99%</item>
</style>
Related