OGeek|极客世界-中国程序员成长平台

标题: c# - 如何在 Xamarin.forms 中更改 Alertbox 的大小 [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-13 09:52
标题: c# - 如何在 Xamarin.forms 中更改 Alertbox 的大小

我想在我的内容页面中使用 AlertBox。我正在以这种方式使用 AlertBox

var alertButton1 = new Button { Text = "SimpleWay" };
alertButton1.Clicked += async (sender, e) => 
{
     await DisplayAlert ("Alert", "You are veiwing data", "OK");
};

当我运行它时,它会成功运行并以默认大小显示数据。但我想改变(垂直增加)它的大小。请帮忙。



Best Answer-推荐答案


您不能手动更改 AlertBox 的大小。当数据插入到 AlertBox 中时,AlertBox 会自动设置其大小。

     await DisplayAlert ("Alert", "You are veiwing data", "OK");    

从这个变化到这样的东西......

     await DisplayAlert ("Alert", <add-a-complete-view>, "OK");

您的警报框会自动调整到所需的内容放置大小。

关于c# - 如何在 Xamarin.forms 中更改 Alertbox 的大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32069187/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://sqlite.in/) Powered by Discuz! X3.4