← Back to Index

TFlexFMXActionSheet

iOS-style action sheet that slides up from bottom with multiple action buttons.

Key Properties

Title: string
Action sheet title/heading.
Message: string
Optional descriptive message text.
Actions: TActionSheetActions
Collection of action button items.
ShowCancelButton: Boolean
Display a separate Cancel button at bottom.
CancelButtonText: string
Custom text for cancel button (default: "Cancel").
SelectedIndex: Integer
Index of action that was selected (-1 if cancelled).
AnimationDuration: Single
Slide animation duration in seconds.

Action Properties

Caption: string
Action button text.
Style: TActionStyle
asDefault, asDestructive (red), asCancel.
ImageIndex: Integer
Optional icon from image list.
Enabled: Boolean
Whether action can be selected.

Usage Examples

Simple Action Sheet

ActionSheet1.Title := 'Choose Action';
ActionSheet1.Actions.Clear;
with ActionSheet1.Actions.Add do
begin
  Caption := 'Edit';
  Style := asDefault;
end;
with ActionSheet1.Actions.Add do
begin
  Caption := 'Delete';
  Style := asDestructive;
end;
ActionSheet1.ShowCancelButton := True;

if ActionSheet1.Execute then
begin
  case ActionSheet1.SelectedIndex of
    0: EditItem;
    1: DeleteItem;
  end;
end;

Share Actions

ActionSheet1.Title := 'Share';
ActionSheet1.Actions.Clear;
ActionSheet1.Actions.Add.Caption := 'Email';
ActionSheet1.Actions.Add.Caption := 'Message';
ActionSheet1.Actions.Add.Caption := 'Copy Link';
ActionSheet1.ShowCancelButton := True;

if ActionSheet1.Execute then
  ShareVia(ActionSheet1.SelectedIndex);

Conditional Actions

ActionSheet1.Actions.Clear;
ActionSheet1.Actions.Add.Caption := 'Download';
with ActionSheet1.Actions.Add do
begin
  Caption := 'Delete from Cloud';
  Style := asDestructive;
  Enabled := UserHasPermission;
end;
ActionSheet1.Execute;

Methods

Events

Notes

← Back to Index