尝试创建警报对话框时出错未触摸

问题描述

我正在创建一个一旦显示在屏幕上就无法禁用的警报对话框,该过程可以正常工作,但是因为我遇到了问题,所以在显示警报对话框时它不会停用,但目前按 Any有动作的按钮,动作被激活,我可以移动屏幕。
这是我的 .cs:

private void ProgressBar()
{
    int padding = 30;
    LinearLayout linearLayout = new LinearLayout(this);
    linearLayout.Orientation = Android.Widget.Orientation.Horizontal;
    linearLayout.SetPadding(padding,padding,padding);
    LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MatchParent,LinearLayout.LayoutParams.MatchParent);

    ProgressBar progress = new ProgressBar(this);
    progress.SetPadding(0,0);

    LinearLayout.LayoutParams layout = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MatchParent,LinearLayout.LayoutParams.MatchParent);
    layout.Gravity = GravityFlags.Center;
    TextView textView = new TextView(this);
    textView.Text = "Enviando...";
    textView.SetTextColor(Color.ParseColor("#000000"));
    textView.TextSize = 20;

    linearLayout.AddView(progress);
    linearLayout.AddView(textView);

    AlertDialog.Builder builder = new AlertDialog.Builder(this);
    builder.SetCancelable(true);
    builder.SetView(linearLayout);

    AlertDialog dialog = builder.Create();
    dialog.Show();

    dialog.Window.SetFlags(WindowManagerFlags.Nottouchable,WindowManagerFlags.Nottouchable);
}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)