iOS-style action sheet that slides up from bottom with multiple action buttons.
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;
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);
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;
Execute - Show action sheet and return True if action selectedShow - Show non-modallyHide - Dismiss action sheetOnActionClick - Action button clicked (provides Index)OnCancel - Cancel button or backdrop clickedOnShow - Action sheet appearsOnHide - Action sheet dismissed