Xamarin.Forms Guides | Samples

Xamarin.Forms.Page.DisplayActionSheet Method

Displays a native platform action sheet, allowing the application user to choose from several buttons.

Syntax

public System.Threading.Tasks.Task<string> DisplayActionSheet (String title, String cancel, String destruction, params String[] buttons)

Parameters

title
Title of the displayed action sheet. Must not be null.
cancel
Text to be displayed in the 'Cancel' button. Can be null to hide the cancel action.
destruction
Text to be displayed in the 'Destruct' button. Can be null to hide the destructive option.
buttons
Text labels for additional buttons. Must not be null.

Returns

An awaitable Task that displays an action sheet and returns the Text of the button pressed by the user.

Remarks

Developers should be aware that Windows' line endings, CR-LF, only work on Windows systems, and are incompatible with iOS and Android. A particular consequence of this is that characters that appear after a CR-LF, (For example, in the title.) may not be displayed on non-Windows platforms. Developers must use the correct line endings for each of the targeted systems.

Requirements

Namespace: Xamarin.Forms
Assembly: Xamarin.Forms.Core (in Xamarin.Forms.Core.dll)
Assembly Versions: 1.0.0.0, 1.1.0.0, 1.2.0.0, 1.3.0.0, 1.4.0.0, 1.5.0.0, 2.0.0.0