【问题标题】:When I call DisplayAlert in a Xamarin app, the screen fades but no alert is displayed当我在 Xamarin 应用程序中调用 DisplayAlert 时,屏幕变暗但不显示警报
【发布时间】:2020-10-04 07:52:05
【问题描述】:

我对 Xamarin 完全陌生,所以这可能很明显。但是,当我运行具有 DisplayAlert 调用的 Xamarin 应用程序时,屏幕会变暗,但不会出现对话框:

<Button x:Name="PlayButton" Text="Play" HorizontalOptions="CenterAndExpand" HeightRequest="100" WidthRequest="200" FontSize="64" Clicked="PlayButton_ClickedAsync"/>
private async void PlayButton_ClickedAsync(object sender, EventArgs e)
{
    await DisplayAlert("Play", "This is where we would start the game.", "OK");
}

如何使此警报实际显示?如果重要的话,我正在使用 UWP 应用程序进行测试,直到 Android 模拟器完成下载...

【问题讨论】:

  • 哇...这个严重的错误已经知道了快四个月了,还没有修复?!
  • 有没有办法将我的 Xamarin 临时降级到旧的工作版本?
  • XF 只是一个 nuget 包,你可以在 Nuget 管理器中选择你喜欢的任何版本

标签: c# xaml xamarin xamarin.uwp


【解决方案1】:

很遗憾,当前版本的 Xamarin Forms (4.6) 中也存在此问题。

您现在可以将 XF 降级到 4.4 版本,使其成为一种解决方法。

按照以下步骤降级:

  1. 右键项目解决方案
  2. 选择 为解决方案管理 Nuget 包...

  1. 找到已安装的xamarin forms nuget包,并选择想要安装的版本

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-11-12
    • 2016-08-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-03-10
    相关资源
    最近更新 更多