谁能告诉我如何在 xamarin C# 中设置警告对话框的宽度和高度。我已经为对话框设置了布局,但它显示的布局宽度较短。下面是我的代码,提前谢谢大家。我试着寻找我能找到的所有内容都是针对 android java 平台的。
代码:
var alert = new AlertDialog.Builder(this);
alert.SetView(LayoutInflater.Inflate(Resource.Layout.SuccessPage, null));
alert.Create().Show();
最佳答案
使用 Window 属性访问布局尺寸:
alert.Window.SetLayout(400, 450);
另一种实现目标的方法是通过 XML 覆盖 alertDialog 的样式,但是您没有显示到目前为止编写的标记。
关于c# - 如何在 Xamarin android c# 中设置 AlertDialog 框的宽度和高度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31189284/