2017-10-04 3 views

Répondre

0

ActionSheet de UIAlertController

// Create a new Alert Controller 
       UIAlertController actionSheetAlert = UIAlertController.Create("Action Sheet", "Select an item from below", UIAlertControllerStyle.ActionSheet); 

       // Add Actions 
       actionSheetAlert.AddAction(UIAlertAction.Create("Item One",UIAlertActionStyle.Default, (action) => Console.WriteLine ("Item One pressed."))); 

       actionSheetAlert.AddAction(UIAlertAction.Create("Item Two",UIAlertActionStyle.Default, (action) => Console.WriteLine ("Item Two pressed."))); 

       actionSheetAlert.AddAction(UIAlertAction.Create("Item Three",UIAlertActionStyle.Default, (action) => Console.WriteLine ("Item Three pressed."))); 

       actionSheetAlert.AddAction(UIAlertAction.Create("Cancel",UIAlertActionStyle.Cancel, (action) => Console.WriteLine ("Cancel button pressed."))); 

       // Required for iPad - You must specify a source for the Action Sheet since it is 
       // displayed as a popover 
       UIPopoverPresentationController presentationPopover = actionSheetAlert.PopoverPresentationController; 
       if (presentationPopover!=null) { 
        presentationPopover.SourceView = this.View; 
        presentationPopover.PermittedArrowDirections = UIPopoverArrowDirection.Up; 
       } 

       // Display the alert 
       this.PresentViewController(actionSheetAlert,true,null); 

Plus d'info: https://developer.xamarin.com/recipes/ios/standard_controls/alertcontroller/

+0

En d'autres termes, ce n'est pas intégré? – GenericTeaCup

+0

Il est construit en! – TonyMkenu

+0

la possibilité de créer une boîte de dialogue est intégrée. Mais le dialogue exact avec les éléments exacts "Appel", "Envoyer un message", ... Doit être fait manuellement. C'est ce que vous voulez dire par intégré, je suppose? – GenericTeaCup