Is there a way to turn off the background in a DisplayActionSheet using Xamarin forms?

Question:

I have a problem with how to turn off the background in DisplayActionSheet or DisplayAlert in Xamarin Forms, so the only way the user can β€œexit” pop-ups is with the parameters that the window caused.


Here is a screenshot of the problem: http://postimg.org/image/s16cp66wf/

Do you know if there is an easy way to do this? I searched, but could not find ....

I tried:

Using the methods that came with the control, but nothing else appeared. What I am doing now is to call him until I have an answer.

Code: From my code, I fire an event

async void OnNextClicked(object sender, EventArgs args) { await userValidations.RMLocationServiceWindow(); } 

And then I call a popup

 public async Task RMLocationServiceWindow () { string rta = null; while (rta == null) { rta = await App.Current.MainPage.DisplayActionSheet("Do you accept to use the service?", "Cancel", "Continue"); } } 

I could not find anyone who would focus on the windows.

+4
source share
2 answers

Unfortunately, this cannot be done in the display table, since you can achieve this, you must create a Modal Page list with a list in which you could turn off the back button until there is a choice in the list. hope this helps

0
source

I think I have your problem. If your problem is that the user does not click Cancel or Continue, and he clicks the empty space, you will not get the value for rta. Think about whether the user will click the space bar, meaning cancel it. This method may help you.

 while (rta == null) { rta = await App.Current.MainPage.DisplayActionSheet("Do you accept to use the service?", "Cancel", "Continue"); if (rta==null) rta=="Cancel"; } 
0
source

All Articles