Sokheang Khun
Sokheang Khun

Reputation: 156

Xamarin Forms Pop UP

I want to show a pop up with buttons in it when I click a button and I want it to pop up near the button like Facebook Popup reaction when we hold on the like button. How can achieve that in Xamarin.Forms? The image below.
The pop up

Upvotes: 0

Views: 198

Answers (1)

Martin Zikmund
Martin Zikmund

Reputation: 39082

There are built-in popup options - Alert and Action Sheet. Both are described in the documentation.

To display an alert you can use:

var answer = await DisplayAlert ("Question?", "Would you like to play a game", "Yes", "No");

If you need to display multiple possible actions the user can take, use action sheet:

var action = await DisplayActionSheet ("ActionSheet: Send to?", "Cancel", null, "Email", "Twitter", "Facebook");

For something more involved you can look around GitHub as there are many third party repositories that might suit your needs. For example this looks promising.

Upvotes: 5

Related Questions