[英]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.