模态页面可以通过三种方式创建:
从NavigationPage对象获取全屏页面
对于警报和通知
对于作为弹出菜单的ActionSheets
... // 打开 await Navigation.PushModalAsync(new ModalPage()); // 关闭 await Navigation.PopModalAsync(); ...
... // 警报 await DisplayAlert("Alert title", "Alert text", "Ok button text"); // 确认 var booleanAnswer = await DisplayAlert("Confirm?", "Confirmation text", "Yes", "No"); ...
... var selectedOption = await DisplayActionSheet("Options", "Cancel", "Destroy", "Option 1", "Option 2", "Option 3"); ...