我们可以通过DisplayAlert()方法在xamarin中为警告框中显示的按钮提供不同的颜色吗?

Sha*_*wal 5 xamarin.forms

我们可以通过DisplayAlert()方法在Xamarin.Forms中为警告框中显示的按钮提供不同的颜色吗?

我可以在android中找到它的解决方案,但我无法进入Xamarin.Forms.

Dan*_*rda 0

这是不可能的。使用 时DisplayActionSheet,您只能使用一种“破坏性”操作,该操作在大多数操作系统上都会显示为红色。

不过,您可以编写自定义版本的警报框。这是一个很好的代码库:https://github.com/aritchie/userdialogs