Я хочу изменить размер макета AlertDialog по умолчанию.Как изменить MvxDialogFragment layout
Я создал класс:
public class SampleDialog : MvxDialogFragment
{
public override Dialog OnCreateDialog(Bundle savedInstanceState)
{
var dialog = new AlertDialog.Builder(Context);
dialog.SetView(View.Inflate(Context,Resource.Layout.SampleDialog,null));
return dialog.Create();
}
public override void OnStart()
{
if (Dialog == null) { return; }
Dialog.Window.SetLayout(200,460);
base.OnStart();
}
}
и это расположение:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/text1" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/text2" />
</LinearLayout>
И я создаю диалог с точкой зрения фрагмента:
var dialog = new SampleDialog
{
ViewModel = ViewModel,
Cancelable = true
};
dialog.Show(FragmentManager, "");
судимых установить ширину макета в OnCreateDialog метод, OnStart или напрямую, установив свойство LinearLayout.layout_width, но результат тот же.
Как это можно настроить?