xamarinxamarin.formsuiactionsheetcancel-button

Action sheet doesn't having cancel button on iPad


I am using xamarin.forms, in my code, I have action sheet it is not having a cancel button in iPad. In iPhone, I can see the cancel button but not in iPad

var action = await DisplayActionSheet(null, "Cancel", null, "string 2","string2");

What wrong i has done or is there any default feature?


Solution

  • This is expected behaviour on iPad - Cancel buttons are removed as the user can tap outside of the sheet to dismiss (cancel) it.

    DisplayActionSheet on iOS uses UIAlertController underneath and the lack of cancel button on iPad is standard behaviour for UIAlertController.