简体   繁体   English

如何更改对话框 window 大小 Android 工作室

[英]How to change DIalog window size Android studio

I'm trying to implement an activity with a dialog theme.我正在尝试使用dialog主题来实现活动。 My manifest.xml我的manifest.xml

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

The problem is that I want to increase the dialog width .问题是我想增加对话框width How can I achieve this?我怎样才能做到这一点? I tried with: styles.xml我试过: 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:但我在底部和顶部都有这个问题: 在此处输入图像描述

Finally, easy solution:最后,简单的解决方案:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM