Skip to content

Overlay Helper for open Custom Popups over content in your app without custom renderer.

License

Notifications You must be signed in to change notification settings

anchorit3/xamarin-overlay-helper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Xamarin.Forms Overlay Helper

For open custom Popups over content in your app without custom renderer.

You can customize popups however you like, you only need one thing.

Create new ContentView and then use as content of Popup.

Maybe this is not perfect solution, but now working with Stacklayout, Grid and ScrollView and with NavigationPage and without.

Requirements:

  • Xamarin.Forms
  • Xamarin.Esseltials

To start using:

1. Import OverlayHelper.cs into your project

2. Add AdjustView method in OnAppearing in your ContentPage

OverlayHelper.AdjustView();

Full example of OnAppearing:

protected override void OnAppearing()
{
    base.OnAppearing();
    OverlayHelper.AdjustView();
}

This part moves Stacklayout, Grid or ScrollView to AbsoluteLayout and adds an Overlay element to it

3. Now you need only open Popup 😉

OverlayHelper.Open(new ExamplePopup1(), AbsoluteLayoutFlags.All,
                    new Rectangle(0, 0.5, 1, 0.3), Color.FromHex("#4d000000"));

In this case we use (ContentView) ExamplePopup1 with (AbsoluteLayoutFlags) LayoutFlags, (Rectangle) LayoutBounds and (Color) Overlay Background Color

For more information about AbsoluteLayoutFlags you can go to Microsoft documentation

How to close Popup programmatically?

OverlayHelper.Close();

Dropdown example

An example of a drop-down menu can be found in ScrollView Example Page (Green button)

License

Licensed under MIT, see license file.

I think it may be useful to many people. Best regards and have a nice use 😁

About

Overlay Helper for open Custom Popups over content in your app without custom renderer.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages