android 4.0 对话框在对话框窗口外被触摸时被取消 [英] android 4.0 Dialog gets canceled when touched outside of dialog window

查看:18
本文介绍了android 4.0 对话框在对话框窗口外被触摸时被取消的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我们在 dialog 窗口外单击时,我在 ICS 上遇到问题,例如 dialog is dismissed,因此我遇到了问题就像我没有得到用户的任何确认.

Hi I am facing the problem on ICS like dialog is dismissed when we click outside dialog window, due to which I am getting problem like I don't get any confirmation from user.

请帮忙.

推荐答案

检查 这个方法 来自 Android 开发者网站的对话.

Check this method from the Android Developers site for dialog.

尝试使用

dialog.setCanceledOnTouchOutside(布尔取消)

传递一个布尔值以启用/禁用在对话窗口外触摸时的对话行为.

Pass a boolean value to enable/disable dialog behaviour when touched outside of the dialog window.

还可以通过这些链接:

在对话框外发生点击时如何触发事件

如何取消在窗口外触摸时会出现类似 Activity 的 Dialog 主题?

我希望这能回答你的问题.

I hope this answers your question.

这篇关于android 4.0 对话框在对话框窗口外被触摸时被取消的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆