Reputation: 1959
I have a xamarin.forms application which uses Rg.Plugins.popup for showing custom popup.Everything works fine. But is there any workaround for making the background page blur when the popup is shown?Thanks in advance
Upvotes: 1
Views: 2700
Reputation: 71
I made nuget package for this. Use for Xamarin.Forms - working in android and ios with smoothly appearing animation. Required Xamarin.Forms >= 4.0.
Check it: PrettyPopup
Upvotes: 3
Reputation: 15806
Solution:
You can create a blur background by using visualelement-blur
on iOS. You can have a look at this document.
Here I write a simple method to explain:
void showBlurBackGround()
{
if (Device.RuntimePlatform == Device.iOS)
{
// change the width and height to your own requirement
var boxView = new BoxView { HeightRequest = 300, WidthRequest = 350 };
boxView.On<iOS>().UseBlurEffect(BlurEffectStyle.ExtraLight);
myLaout.Children.Add(boxView);
}
else if (Device.RuntimePlatform == Device.Android)
{
// add your image
}
}
I'm not familiar with Android maybe you can find a better solution instead of add a blurred screenshot. You can try creating some bitmaps and blurring them.
Upvotes: 1