且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何控制机器人的宽度和默认警报对话框的高度?

更新时间:2023-11-19 09:13:58

我不知道您是否可以更改AlertDialog的默认高度/宽度,但如果你想做到这一点,我想你可以通过创建自己的自定义做对话。你只需要给安卓主题=@安卓风格/ Theme.Dialog在android的manifest.xml为您的活动,可以写整个布局按照您的需求。您可以设置从Android资源XML自定义对话框的高度和宽度。

I dont know whether you can change the default height/width of AlertDialog but if you wanted to do this, I think you can do it by creating your own custom dialog. You just have to give android:theme="@android:style/Theme.Dialog" in the android manifest.xml for your activity and can write the whole layout as per your requirement. you can set the height and width of your custom dialog from the Android Resource XML.