简体   繁体   中英

How to close popup layout on outside click?

I am working in xamarin forms. I am usng PopupLayout control to show the popup on screen. Now I want that if user click outside the popup popup should be dismiss. How I can do this? What property of PopupLayout I can use?

Regards, Anand Dubey

One way to do this is to have a transparent ContentView covering the screen. Add a GestureRecognizer to the ContentView which, when clicked, will hide the PopupControl .

When the PopupControl is not showing, set ContentView.InputTransparent to true so clicks do not register, or remove the ContentView from the screen completely.

When you show the PopupControl , set ContentView.InputTransparent to false or add in the ContentView if you removed it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM