[英]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>
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.