C# Xamarin中的自定义对话框宽度和高度
我试图在Xamarin中构建一个自定义对话框,如下所示。但是,我无法找到一个属性来设置对话框C# Xamarin中的自定义对话框宽度和高度,c#,xamarin,xamarin.android,C#,Xamarin,Xamarin.android,我试图在Xamarin中构建一个自定义对话框,如下所示。但是,我无法找到一个属性来设置对话框width和height var view = this.BindingInflate(Resource.Layout.SetDialogView, null); var dialog = new AlertDialog.Builder(Activity); dialog.SetView(view); dialog.SetTitle("Settings"); var dialg = dialog.Crea
width
和height
var view = this.BindingInflate(Resource.Layout.SetDialogView, null);
var dialog = new AlertDialog.Builder(Activity);
dialog.SetView(view);
dialog.SetTitle("Settings");
var dialg = dialog.Create();
layoutParams.Gravity = GravityFlags.Center;
dialg.Show();
dialg.Window.SetLayout(300, 300);
试试这个,有点棘手(展示它,然后改变大小),但工作:
dialg.Show();
dialg.Window.SetLayout(300, 300);
请把我的答案标记为正确。