开发者

Is there a way to dismiss a dialog when the user clicks the transparent area around it?

开发者 https://www.devze.com 2023-03-22 19:30 出处:网络
I have a few little custom dialogs in my app, and they are kinda sma开发者_如何学Goll. I\'ve noticed that the user touches the area around the dialog to try to dismiss it (similar to interaction on a

I have a few little custom dialogs in my app, and they are kinda sma开发者_如何学Goll. I've noticed that the user touches the area around the dialog to try to dismiss it (similar to interaction on a website). I was wondering if there are any built in methods for doing this that I must have missed in the doc, or if there are any tutorials out there on how to approach implementing this?

I don't think I'm explaining this well, so if anyone doesn't understand what I'm talking about I will try to provide more information.

Thanks in advance.

EDIT

Found the answer in a question linked by Balaji:

dialog.setCanceledOnTouchOutside(true);


Found the answer in a question linked by Balaji:

dialog.setCanceledOnTouchOutside(true);
0

精彩评论

暂无评论...
验证码 换一张
取 消