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.
- Xamarin.Forms
- Xamarin.Esseltials
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
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
OverlayHelper.Close();
An example of a drop-down menu can be found in ScrollView Example Page
(Green button)
Licensed under MIT, see license file.
I think it may be useful to many people. Best regards and have a nice use 😁