简体   繁体   English

如何在xamarin.ios本机应用程序中显示DisplayActionSheet

[英]How to show DisplayActionSheet in xamarin.ios native app

We want to show DisplayActionSheet on button click in our xamarin.ios native app but its throw compile time error as "DisplayActionSheet does not exist in current context". 我们想在我们的xamarin.ios本地应用程序中单击按钮时显示DisplayActionSheet,但是它会抛出编译时错误,因为“ DisplayActionSheet在当前上下文中不存在”。 How to solve this issue.. please help 如何解决这个问题..请帮助

DisplayActionSheet is not native iOs and thats why you are getting the error. DisplayActionSheet不是本机iO,这就是为什么您会收到错误。 What you want to do is create a new UIAlertController, add actions and present it. 您要做的是创建一个新的UIAlertController,添加操作并显示它。

Simple example : 简单的例子:

var alertController = UIAlertController.Create(null, "Title", UIAlertControllerStyle.ActionSheet);
alertController.AddAction(UIAlertAction.Create("Text", UIAlertActionStyle.Default, action => { /* handle your action */ }));
viewController.PresentViewController(alertController, true, null);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在 Xamarin.iOS 应用程序中创建导航? - How to create navigation in a Xamarin.iOS app? 如何在 xamarin.ios 本机应用程序中的前台应用程序时获取推送/远程通知? - How to get push/remote notification when app in foreground in xamarin.ios native app? 如何在Xamarin.ios本机应用程序的自定义控制器类中打开新的故事板? - How do I open a new storyboard from custom controller class in Xamarin.ios native app? 如何解决,UIAlertController(ActionSheet)在xamarin.ios本机应用程序的iPad上崩溃了? - How to solve, UIAlertController (ActionSheet) is Crashed on iPad in xamarin.ios native app? 如何在Xamarin.iOS本机平台中展开表格视图单元? - How to expand a tableview cell in Xamarin.iOS native platform? 如何在 xamarin.ios 中的 TouchUpInside function 中显示 UIView? - How to show UIView from a TouchUpInside function in xamarin.ios? 网络可用时,如何在xamarin.ios应用程序中更改视图? - How to change view in xamarin.ios app when network is available? 本机链接在 xamarin.iOS 中失败 - Native linking failed in xamarin.iOS 如何在Xamarin.ios应用程序中比较CBUUID对象 - How to compare CBUUID objects in Xamarin.ios app 如何在 MVVMCross Xamarin.iOS 中计算应用程序空闲时间? - How to calculate App Idle Time in MVVMCross Xamarin.iOS?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM