当用户单击对话框周围的透明区域时,有没有办法关闭对话框?
我的应用程序中有一些小的自定义对话框,它们有点小。我注意到用户触摸对话框周围的区域以尝试将其关闭(类似于网站上的交互)。我想知道是否有任何内置方法可以做到这一点,我一定在文档中错过了,或者是否有任何关于如何实现这一点的教程?
我认为我解释得不好,所以如果有人不明白我在说什么,我会尽力提供更多信息。
提前致谢。
编辑
在巴拉吉链接的问题中找到了答案:
dialog.setCanceledOnTouchOutside(true);
I have a few little custom dialogs in my app, and they are kinda small. 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);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 Balaji 链接的问题中找到了答案:
Found the answer in a question linked by Balaji: